fix: price reduction on deletion

This commit is contained in:
2024-06-25 22:51:14 +03:00
parent cefabd1c70
commit f182c80210

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();