Compare commits
4 Commits
17c92496a9
...
3859700212
| Author | SHA1 | Date | |
|---|---|---|---|
| 3859700212 | |||
| 8e352e729a | |||
| 48f2664d2f | |||
| f98fabf579 |
@@ -1,10 +1,21 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'pages/create_recipe_page.dart';
|
||||
import 'pages/overview_page.dart';
|
||||
import 'services/providers/recipe_provider.dart';
|
||||
|
||||
void main() {
|
||||
runApp(const RecipeJournal());
|
||||
runApp(
|
||||
MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => RecipeProvider(),
|
||||
),
|
||||
],
|
||||
child: const RecipeJournal(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
class RecipeJournal extends StatelessWidget {
|
||||
|
||||
@@ -13,8 +13,8 @@ class Recipe {
|
||||
final Duration cookTime;
|
||||
final Duration totalTime;
|
||||
final List<String> keywords;
|
||||
final MealCategory mealCategory;
|
||||
final Cuisine cuisine;
|
||||
final MealCategory? mealCategory;
|
||||
final Cuisine? cuisine;
|
||||
|
||||
Recipe({
|
||||
this.id = -1,
|
||||
@@ -25,8 +25,8 @@ class Recipe {
|
||||
this.prepTime = const Duration(),
|
||||
this.cookTime = const Duration(),
|
||||
this.totalTime = const Duration(),
|
||||
this.mealCategory = MealCategory.notSelected,
|
||||
this.cuisine = Cuisine.notSelected,
|
||||
this.mealCategory,
|
||||
this.cuisine,
|
||||
this.ingredients = const [],
|
||||
this.keywords = const [],
|
||||
this.steps = const [],
|
||||
|
||||
6
lib/services/tools.dart
Normal file
6
lib/services/tools.dart
Normal file
@@ -0,0 +1,6 @@
|
||||
String getEnumValueName<T extends Enum>(T value) {
|
||||
String name =
|
||||
value.name.replaceAllMapped(RegExp(r'[A-Z]'), (match) => ' ${match[0]}');
|
||||
name = name[0].toUpperCase() + name.substring(1);
|
||||
return name;
|
||||
}
|
||||
@@ -16,7 +16,6 @@ enum Difficulty {
|
||||
}
|
||||
|
||||
enum IngredientType {
|
||||
notSelected,
|
||||
vegetable,
|
||||
meat,
|
||||
fish,
|
||||
@@ -29,7 +28,6 @@ enum IngredientType {
|
||||
}
|
||||
|
||||
enum MealCategory {
|
||||
notSelected,
|
||||
// Main Meals
|
||||
breakfast,
|
||||
brunch,
|
||||
@@ -46,7 +44,6 @@ enum MealCategory {
|
||||
}
|
||||
|
||||
enum Cuisine {
|
||||
notSelected,
|
||||
// Asian Cuisines
|
||||
chinese,
|
||||
japanese,
|
||||
|
||||
Reference in New Issue
Block a user