swapped methods for better readability (maybe?)
This commit is contained in:
parent
eecb60ab0e
commit
da32131f0d
1 changed files with 21 additions and 21 deletions
|
@ -38,27 +38,6 @@ class PizzaEventPageState extends State<PizzaEventPage> {
|
||||||
buildRecipeStepWidgetWithoutSubSteps(recipeStep);
|
buildRecipeStepWidgetWithoutSubSteps(recipeStep);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget buildRecipeStepWidgetWithSubSteps(RecipeStep recipeStep){
|
|
||||||
int recipeSubStepsCompleted = recipeStep.subSteps.where((subStep) => subStep.completed).length;
|
|
||||||
int recipeSubSteps = recipeStep.subSteps.length;
|
|
||||||
return ExpansionTile(
|
|
||||||
title: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: <Widget>[
|
|
||||||
Icon(FontAwesome5.sitemap),
|
|
||||||
Text(recipeStep.name),
|
|
||||||
Text("$recipeSubStepsCompleted/$recipeSubSteps")
|
|
||||||
],
|
|
||||||
),
|
|
||||||
children: <Widget>[
|
|
||||||
Text(recipeStep.description),
|
|
||||||
Column(
|
|
||||||
children: recipeStep.subSteps.map((subStep) => getSubStepWidget(subStep)).toList()
|
|
||||||
)
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget buildRecipeStepWidgetWithoutSubSteps(RecipeStep recipeStep) {
|
Widget buildRecipeStepWidgetWithoutSubSteps(RecipeStep recipeStep) {
|
||||||
return ExpansionTile(
|
return ExpansionTile(
|
||||||
title: Row(
|
title: Row(
|
||||||
|
@ -91,6 +70,27 @@ class PizzaEventPageState extends State<PizzaEventPage> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget buildRecipeStepWidgetWithSubSteps(RecipeStep recipeStep){
|
||||||
|
int recipeSubStepsCompleted = recipeStep.subSteps.where((subStep) => subStep.completed).length;
|
||||||
|
int recipeSubSteps = recipeStep.subSteps.length;
|
||||||
|
return ExpansionTile(
|
||||||
|
title: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: <Widget>[
|
||||||
|
Icon(FontAwesome5.sitemap),
|
||||||
|
Text(recipeStep.name),
|
||||||
|
Text("$recipeSubStepsCompleted/$recipeSubSteps")
|
||||||
|
],
|
||||||
|
),
|
||||||
|
children: <Widget>[
|
||||||
|
Text(recipeStep.description),
|
||||||
|
Column(
|
||||||
|
children: recipeStep.subSteps.map((subStep) => getSubStepWidget(subStep)).toList()
|
||||||
|
)
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Widget getSubStepWidget(RecipeSubStep recipeSubStep){
|
Widget getSubStepWidget(RecipeSubStep recipeSubStep){
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
|
|
Loading…
Add table
Reference in a new issue