added models
This commit is contained in:
11
lib/models/ingredient.dart
Normal file
11
lib/models/ingredient.dart
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
class Ingredient {
|
||||||
|
final String title;
|
||||||
|
List<String> possibleUnits = [];
|
||||||
|
List<String> preferredBrands = [];
|
||||||
|
|
||||||
|
Ingredient({
|
||||||
|
required this.title,
|
||||||
|
required this.possibleUnits,
|
||||||
|
required this.preferredBrands,
|
||||||
|
});
|
||||||
|
}
|
||||||
18
lib/models/recipe.dart
Normal file
18
lib/models/recipe.dart
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import 'ingredient.dart';
|
||||||
|
import 'steps.dart';
|
||||||
|
|
||||||
|
class Recipe {
|
||||||
|
final String title;
|
||||||
|
final String description;
|
||||||
|
final Difficulty? difficulty;
|
||||||
|
final List<Ingredient> ingredients = [];
|
||||||
|
final Steps steps = Steps();
|
||||||
|
|
||||||
|
Recipe({
|
||||||
|
required this.title,
|
||||||
|
this.description = '',
|
||||||
|
this.difficulty,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Difficulty { veryEasy, easy, intermediate, hard, veryHard }
|
||||||
13
lib/models/steps.dart
Normal file
13
lib/models/steps.dart
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
/// 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 = ''});
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user