From da32131f0d334938f2d961b24f8e85fa366ddfd1 Mon Sep 17 00:00:00 2001 From: broodjeaap89 Date: Mon, 9 Aug 2021 20:47:12 +0200 Subject: [PATCH] swapped methods for better readability (maybe?) --- lib/pages/PizzaEventPage.dart | 42 +++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/pages/PizzaEventPage.dart b/lib/pages/PizzaEventPage.dart index b05d73f..969cc68 100644 --- a/lib/pages/PizzaEventPage.dart +++ b/lib/pages/PizzaEventPage.dart @@ -38,27 +38,6 @@ class PizzaEventPageState extends State { 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: [ - Icon(FontAwesome5.sitemap), - Text(recipeStep.name), - Text("$recipeSubStepsCompleted/$recipeSubSteps") - ], - ), - children: [ - Text(recipeStep.description), - Column( - children: recipeStep.subSteps.map((subStep) => getSubStepWidget(subStep)).toList() - ) - ] - ); - } - Widget buildRecipeStepWidgetWithoutSubSteps(RecipeStep recipeStep) { return ExpansionTile( title: Row( @@ -91,6 +70,27 @@ class PizzaEventPageState extends State { ); } + 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: [ + Icon(FontAwesome5.sitemap), + Text(recipeStep.name), + Text("$recipeSubStepsCompleted/$recipeSubSteps") + ], + ), + children: [ + Text(recipeStep.description), + Column( + children: recipeStep.subSteps.map((subStep) => getSubStepWidget(subStep)).toList() + ) + ] + ); + } + Widget getSubStepWidget(RecipeSubStep recipeSubStep){ return InkWell( onTap: () async {