Clearing shopping cart
This commit is contained in:
@@ -151,6 +151,23 @@ class _BasketPageState extends State<BasketPage> {
|
||||
),
|
||||
child: const Text('Оформить заказ'),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
await clearCart();
|
||||
setState(() {
|
||||
cartItems = [];
|
||||
});
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(50))),
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
child: const Text('Очистить корзину'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user