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