changed recipe class
This commit is contained in:
@@ -15,6 +15,7 @@ class Recipe {
|
||||
this.ingredients = const [],
|
||||
this.keywords = const [],
|
||||
this.steps = const [],
|
||||
this.servingSize = 0,
|
||||
});
|
||||
|
||||
final Duration cookTime;
|
||||
@@ -29,6 +30,7 @@ class Recipe {
|
||||
final Duration prepTime;
|
||||
final List<String> steps;
|
||||
final String title;
|
||||
final int servingSize;
|
||||
|
||||
Duration get totalTime => cookTime + prepTime;
|
||||
|
||||
@@ -46,6 +48,7 @@ class Recipe {
|
||||
List<String>? keywords,
|
||||
MealCategory? mealCategory,
|
||||
Cuisine? cuisine,
|
||||
int? servingSize,
|
||||
}) {
|
||||
return Recipe(
|
||||
id: id ?? this.id,
|
||||
@@ -66,6 +69,7 @@ class Recipe {
|
||||
: List<String>.from(this.keywords),
|
||||
mealCategory: mealCategory ?? this.mealCategory,
|
||||
cuisine: cuisine ?? this.cuisine,
|
||||
servingSize: servingSize ?? this.servingSize,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user