Compare commits
4 Commits
faa52dcaa2
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| f182c80210 | |||
| cefabd1c70 | |||
| f1055d40a4 | |||
| cfe0184e3a |
@@ -27,9 +27,10 @@ class ProductCard extends StatelessWidget {
|
|||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
child: ConstrainedBox(
|
child: ConstrainedBox(
|
||||||
constraints: BoxConstraints(
|
constraints: BoxConstraints(
|
||||||
minHeight: 160,
|
minHeight: 160,
|
||||||
maxHeight: getCardHeight(context: context),
|
maxHeight: getCardHeight(context: context),
|
||||||
),
|
minWidth: 180,
|
||||||
|
maxWidth: 250),
|
||||||
child: Card(
|
child: Card(
|
||||||
elevation: 3,
|
elevation: 3,
|
||||||
color: Theme.of(context).scaffoldBackgroundColor,
|
color: Theme.of(context).scaffoldBackgroundColor,
|
||||||
|
|||||||
@@ -155,6 +155,8 @@ class _BasketPageState extends State<BasketPage> {
|
|||||||
removeItemFromCart(id);
|
removeItemFromCart(id);
|
||||||
setState(() {
|
setState(() {
|
||||||
cartItems.removeWhere((element) => element.id == id);
|
cartItems.removeWhere((element) => element.id == id);
|
||||||
|
totalPrice = cartItems.fold(
|
||||||
|
0, (sum, item) => sum + item.price * item.localCount);
|
||||||
});
|
});
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
_updateCart();
|
_updateCart();
|
||||||
@@ -311,7 +313,7 @@ class _BasketPageState extends State<BasketPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
_buildSpacer(),
|
// _buildSpacer(),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.symmetric(
|
padding: const EdgeInsetsDirectional.symmetric(
|
||||||
horizontal: 10, vertical: 10),
|
horizontal: 10, vertical: 10),
|
||||||
@@ -354,7 +356,7 @@ class _BasketPageState extends State<BasketPage> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 50),
|
// const SizedBox(width: 50),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import 'package:gymlink_module_web/pages/order_history.dart';
|
|||||||
import 'package:gymlink_module_web/providers/cart.dart';
|
import 'package:gymlink_module_web/providers/cart.dart';
|
||||||
import 'package:gymlink_module_web/tools/items.dart';
|
import 'package:gymlink_module_web/tools/items.dart';
|
||||||
import 'package:gymlink_module_web/tools/prefs.dart';
|
import 'package:gymlink_module_web/tools/prefs.dart';
|
||||||
import 'package:gymlink_module_web/tools/relative.dart';
|
|
||||||
import 'package:gymlink_module_web/tools/routes.dart';
|
import 'package:gymlink_module_web/tools/routes.dart';
|
||||||
import 'package:gymlink_module_web/tools/text.dart';
|
import 'package:gymlink_module_web/tools/text.dart';
|
||||||
import 'package:lazy_load_scrollview/lazy_load_scrollview.dart';
|
import 'package:lazy_load_scrollview/lazy_load_scrollview.dart';
|
||||||
@@ -74,6 +73,7 @@ class _MainPageState extends State<MainPage> {
|
|||||||
List<GymCategory> categories = [];
|
List<GymCategory> categories = [];
|
||||||
GymCategory? selectedCategory;
|
GymCategory? selectedCategory;
|
||||||
final ScrollController _scrollController = ScrollController();
|
final ScrollController _scrollController = ScrollController();
|
||||||
|
final TextEditingController _searchField = TextEditingController();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@@ -124,6 +124,9 @@ class _MainPageState extends State<MainPage> {
|
|||||||
|
|
||||||
void _onSearch() {
|
void _onSearch() {
|
||||||
final categoryId = selectedCategory == null ? '' : selectedCategory!.id;
|
final categoryId = selectedCategory == null ? '' : selectedCategory!.id;
|
||||||
|
setState(() {
|
||||||
|
searchText = _searchField.text.trim().toLowerCase();
|
||||||
|
});
|
||||||
_searchItems(searchText: searchText, categoryId: categoryId);
|
_searchItems(searchText: searchText, categoryId: categoryId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,12 +145,13 @@ class _MainPageState extends State<MainPage> {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TextField(
|
child: TextField(
|
||||||
onChanged: (value) => setState(() {
|
onChanged: (value) {
|
||||||
searchText = value.trim().toLowerCase();
|
searchText = value.trim().toLowerCase();
|
||||||
if (searchText == '') {
|
if (searchText == '') {
|
||||||
_onSearch();
|
_onSearch();
|
||||||
}
|
}
|
||||||
}),
|
},
|
||||||
|
controller: _searchField,
|
||||||
textInputAction: TextInputAction.search,
|
textInputAction: TextInputAction.search,
|
||||||
onSubmitted: (_) => _onSearch(),
|
onSubmitted: (_) => _onSearch(),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
@@ -179,7 +183,7 @@ class _MainPageState extends State<MainPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
getSpacer(context: context, flex: 2),
|
// getSpacer(context: context, flex: 2),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 8,
|
width: 8,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import 'package:gymlink_module_web/components/heading.dart';
|
|||||||
import 'package:gymlink_module_web/components/history_item_card.dart';
|
import 'package:gymlink_module_web/components/history_item_card.dart';
|
||||||
import 'package:gymlink_module_web/interfaces/items.dart';
|
import 'package:gymlink_module_web/interfaces/items.dart';
|
||||||
import 'package:gymlink_module_web/tools/history.dart';
|
import 'package:gymlink_module_web/tools/history.dart';
|
||||||
import 'package:gymlink_module_web/tools/relative.dart';
|
|
||||||
import 'package:lazy_load_scrollview/lazy_load_scrollview.dart';
|
import 'package:lazy_load_scrollview/lazy_load_scrollview.dart';
|
||||||
|
|
||||||
List<Map<String, String>> orders = [
|
List<Map<String, String>> orders = [
|
||||||
@@ -179,9 +178,9 @@ class _HistoryPageState extends State<HistoryPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
my_orders.isEmpty
|
// my_orders.isEmpty
|
||||||
? const SizedBox.shrink()
|
// ? const SizedBox.shrink()
|
||||||
: getSpacer(context: context)
|
// : getSpacer(context: context)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user