refactored cooking steps

This commit is contained in:
SomnusVeritas
2023-10-17 22:25:48 +02:00
parent 31a5933919
commit 7a8e6a3c65
4 changed files with 14 additions and 15 deletions

View File

@@ -0,0 +1,6 @@
class CookingStep {
final String title;
final String description;
CookingStep({required this.title, this.description = ''});
}

View File

@@ -10,4 +10,10 @@ class Ingredient {
required this.possibleUnits,
this.preferredBrands = const [],
});
@override
bool operator ==(other) {
Ingredient i = other as Ingredient;
return title == i.title;
}
}

View File

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

View File

@@ -1,13 +0,0 @@
/// Used to display the steps required to cook the referenced recipe
class Steps {
final List<CookingStep> steps = [];
void add(CookingStep step) => steps.add(step);
}
class CookingStep {
final String title;
final String description;
CookingStep({required this.title, this.description = ''});
}