1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-10 14:58:34 +00:00

Updates detail screen to new, modal design. (#40)

This commit is contained in:
Andrew Brogdon
2018-12-21 08:28:28 -08:00
committed by GitHub
parent bfb8b8aea9
commit 6ce0d22e9b
7 changed files with 198 additions and 63 deletions

View File

@@ -32,9 +32,9 @@ class AppState extends Model {
.where((v) => v.name.toLowerCase().contains(terms.toLowerCase()))
.toList();
void toggleFavorite(int id) {
void setFavorite(int id, bool isFavorite) {
Veggie veggie = getVeggie(id);
veggie.isFavorite = !veggie.isFavorite;
veggie.isFavorite = isFavorite;
notifyListeners();
}