mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
Added trailing button to delete cart item in provider_shopper App (#571)
This commit is contained in:
@@ -40,4 +40,11 @@ class CartModel extends ChangeNotifier {
|
||||
// depend on it.
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void remove(Item item) {
|
||||
_itemIds.remove(item.id);
|
||||
// Don't forget to tell dependent widgets to rebuild _every time_
|
||||
// you change the model.
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user