changed up the way that ingredients can be added

This commit is contained in:
SomnusVeritas
2023-10-04 16:35:17 +02:00
parent 518631f37f
commit 263fe00407
5 changed files with 133 additions and 8 deletions

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:rezepte/widgets/ingredients_bottomsheet.dart';
import '../widgets/ingredients_widget.dart';
import '../models/difficulty.dart';
@@ -43,9 +44,7 @@ class _CreateRecipeState extends State<CreateRecipe> {
DifficultyDropdown(
onChanged: _onChanged,
),
IngredientsWidget(
width: width * 0.9,
),
FloatingActionButton(onPressed: _openIngredientBottomSheet),
],
),
),
@@ -55,4 +54,11 @@ class _CreateRecipeState extends State<CreateRecipe> {
void _onChanged(int index) {
_recipeDifficulty = Difficulty.values.elementAt(index);
}
void _openIngredientBottomSheet() {
showModalBottomSheet(
context: context,
builder: (context) => const IngredientsBottomsheet(),
);
}
}