bugfix in creatview and regenerated linux folde

This commit is contained in:
SomnusVeritas
2023-11-14 13:10:42 +01:00
parent e4fe16ac06
commit 6571e37161
5 changed files with 134 additions and 29 deletions

View File

@@ -13,13 +13,13 @@ class AddRecipeInfoWidget extends StatefulWidget {
}
class _AddRecipeInfoWidgetState extends State<AddRecipeInfoWidget> {
late Recipe? recipe;
late RecipeProvider recipeProvider;
@override
Widget build(BuildContext context) {
recipe = Provider.of<RecipeProvider>(context, listen: true).recipe;
recipeProvider = Provider.of<RecipeProvider>(context, listen: true);
if (recipe == null) {
if (recipeProvider.recipe == null) {
return const Center(
child: CircularProgressIndicator(),
);
@@ -28,34 +28,37 @@ class _AddRecipeInfoWidgetState extends State<AddRecipeInfoWidget> {
return Column(
children: [
TextFormField(
initialValue: recipeProvider.recipe!.title,
onTapOutside: (event) => FocusScope.of(context).unfocus(),
onChanged: (value) => recipe!.title = value,
onChanged: (value) => recipeProvider.recipe!.title = value,
decoration: const InputDecoration(
label: Text('Title'),
),
style: TextStyle(color: Theme.of(context).colorScheme.onBackground),
),
TextFormField(
initialValue: recipeProvider.recipe!.description,
onTapOutside: (event) => FocusScope.of(context).unfocus(),
minLines: 1,
maxLines: 4,
onChanged: (value) => recipe!.description = value,
onChanged: (value) => recipeProvider.recipe!.description = value,
decoration: const InputDecoration(
label: Text('Description'),
),
style: TextStyle(color: Theme.of(context).colorScheme.onBackground),
),
DropdownMenu<Difficulty>(
initialSelection: recipeProvider.recipe!.difficulty,
dropdownMenuEntries: DifficultyUtil.getDropdownList(),
onSelected: (value) =>
recipe!.difficulty = value ?? Difficulty.notSelected,
onSelected: (value) => recipeProvider.recipe!.difficulty =
value ?? Difficulty.notSelected,
label: const Text('Difficulty'),
textStyle:
TextStyle(color: Theme.of(context).colorScheme.onBackground),
),
// ElevatedButton(
// onPressed: _openIngredientBottomSheet,
// child: const Text('Add Ingredient'),
// child: const Text('Add Ingred ient'),
// ),
// Expanded(
// child: ListView.separated(