Compare commits

..

4 Commits

Author SHA1 Message Date
f182c80210 fix: price reduction on deletion 2024-06-25 22:51:14 +03:00
cefabd1c70 fix: img loading on changing search text 2024-06-25 22:36:18 +03:00
f1055d40a4 fix: remove spacer 2024-06-25 13:58:41 +03:00
cfe0184e3a fix: card width 2024-06-24 22:35:47 +03:00
4 changed files with 19 additions and 13 deletions

View File

@@ -29,7 +29,8 @@ class ProductCard extends StatelessWidget {
constraints: BoxConstraints(
minHeight: 160,
maxHeight: getCardHeight(context: context),
),
minWidth: 180,
maxWidth: 250),
child: Card(
elevation: 3,
color: Theme.of(context).scaffoldBackgroundColor,

View File

@@ -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),
],
),
),

View File

@@ -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,
),

View File

@@ -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)
],
),
),