diff --git a/lib/entities/PizzaRecipe/RecipeStep.dart b/lib/entities/PizzaRecipe/RecipeStep.dart index a631f8f..4c4b8b3 100644 --- a/lib/entities/PizzaRecipe/RecipeStep.dart +++ b/lib/entities/PizzaRecipe/RecipeStep.dart @@ -6,8 +6,11 @@ class RecipeStep { final String waitUnit; final int waitMin; final int waitMax; + late int waitValue; final String description; final List subSteps; - RecipeStep(this.name, this.waitDescription, this.description, this.waitUnit, this.waitMin, this.waitMax, this.subSteps); + RecipeStep(this.name, this.description, this.waitDescription, this.waitUnit, this.waitMin, this.waitMax, this.subSteps) { + waitValue = waitMin; + } } \ No newline at end of file diff --git a/lib/pages/AddPizzaEventPage.dart b/lib/pages/AddPizzaEventPage.dart index 74e15c0..b66c3ad 100644 --- a/lib/pages/AddPizzaEventPage.dart +++ b/lib/pages/AddPizzaEventPage.dart @@ -156,6 +156,32 @@ class AddPizzaEventPageState extends State { ] ), Divider(), + this.initialized ? Column( + children: this.pizzaRecipe.recipeSteps.where((recipeStep) => recipeStep.waitDescription.length > 0).map((recipeStep) { + return [ + Text(recipeStep.waitDescription), + Row( + children: [ + Expanded( + child: Slider( + value: recipeStep.waitValue.toDouble(), + min: recipeStep.waitMin.toDouble(), + max: recipeStep.waitMax.toDouble(), + divisions: recipeStep.waitMax - recipeStep.waitMin, + label: recipeStep.waitValue.toString(), + onChanged: (newValue) => setState(() => recipeStep.waitValue = newValue.toInt()), + ) + ), + Container( + width: 25, + child: Text(recipeStep.waitValue.toString()) + ) + ] + ) + ]; + }).expand((option) => option).toList() + ) : Container(), + Divider(), this.initialized ? this.pizzaRecipe.getIngredientsTable(this.pizzaCount, this.doughBallSize) : Container(), Divider(), Spacer(),