1
0
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:
Alabhya
2020-10-30 23:28:48 +05:30
committed by GitHub
parent 2165099fc9
commit 0188371865
3 changed files with 16 additions and 3 deletions

View File

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