added willpopscope

This commit is contained in:
SomnusVeritas
2023-11-01 14:53:42 +01:00
parent c537acc796
commit 0f1222040f
2 changed files with 85 additions and 37 deletions

View File

@@ -12,13 +12,27 @@ class RecipeProvider extends ChangeNotifier implements Recipe {
final List<IngredientListEntry> _ingredients = [];
final List<CookingStep> _steps = [];
void clearRecipe() {
void clearRecipe({silent = false}) {
_title = '';
_description = '';
_difficulty = null;
_ingredients.clear();
_steps.clear();
notifyListeners();
if (!silent) {
notifyListeners();
}
}
bool get isEmpty {
return _title.isEmpty &&
_description.isEmpty &&
_difficulty == null &&
_ingredients.isEmpty &&
steps.isEmpty;
}
bool get isNotEmpty {
return !isEmpty;
}
@override