added 'wait options' to addPizzaEventPage

This commit is contained in:
broodjeaap89 2021-07-11 11:56:09 +02:00
parent d4dcd2479d
commit 8420188d9c
2 changed files with 30 additions and 1 deletions

View file

@ -6,8 +6,11 @@ class RecipeStep {
final String waitUnit;
final int waitMin;
final int waitMax;
late int waitValue;
final String description;
final List<RecipeSubStep> 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;
}
}

View file

@ -156,6 +156,32 @@ class AddPizzaEventPageState extends State<AddPizzaEventPage> {
]
),
Divider(),
this.initialized ? Column(
children: this.pizzaRecipe.recipeSteps.where((recipeStep) => recipeStep.waitDescription.length > 0).map((recipeStep) {
return <Widget>[
Text(recipeStep.waitDescription),
Row(
children: <Widget>[
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(),