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