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

Adds analysis options to Veggie Seasons (#98)

This commit is contained in:
Andrew Brogdon
2019-07-01 10:26:50 -07:00
committed by GitHub
parent 2ec8cc3684
commit 4646f0fc8e
13 changed files with 65 additions and 42 deletions

View File

@@ -32,19 +32,19 @@ class Preferences extends Model {
return Set.from(_preferredCategories);
}
void addPreferredCategory(VeggieCategory category) async {
Future<void> addPreferredCategory(VeggieCategory category) async {
_preferredCategories.add(category);
await _saveToSharedPrefs();
notifyListeners();
}
void removePreferredCategory(VeggieCategory category) async {
Future<void> removePreferredCategory(VeggieCategory category) async {
_preferredCategories.remove(category);
await _saveToSharedPrefs();
notifyListeners();
}
void setDesiredCalories(int calories) async {
Future<void> setDesiredCalories(int calories) async {
_desiredCalories = calories;
await _saveToSharedPrefs();
notifyListeners();