refactored recipe provider

This commit is contained in:
SomnusVeritas
2023-11-01 14:37:04 +01:00
parent a29f37b0e8
commit c537acc796
4 changed files with 23 additions and 22 deletions

View File

@@ -8,4 +8,10 @@ class IngredientListEntry {
final bool optional;
IngredientListEntry(this.ingredient, this.amount, this.unit, this.optional);
@override
operator ==(Object other) {
final i = other as IngredientListEntry;
return ingredient == i.ingredient;
}
}

View File

@@ -1,12 +1,12 @@
import 'difficulty.dart';
import 'ingredient.dart';
import 'cooking_step.dart';
import 'ingredient_list_entry.dart';
class Recipe {
final String title;
final String description;
final Difficulty? difficulty;
final List<Ingredient> ingredients = [];
final List<IngredientListEntry> ingredients = [];
final List<CookingStep> steps = [];
Recipe({