diff --git a/lib/entities/PizzaRecipe/Ingredient.dart b/lib/entities/PizzaRecipe/Ingredient.dart index d8af070..c345518 100644 --- a/lib/entities/PizzaRecipe/Ingredient.dart +++ b/lib/entities/PizzaRecipe/Ingredient.dart @@ -9,7 +9,7 @@ class Ingredient { Ingredient(this.name, this.unit, this.value); - TableRow getIngredientWidget(int pizzaCount, int doughBallSize){ + TableRow getIngredientTableRow(int pizzaCount, int doughBallSize){ return TableRow( children: [ TableCell(child: Center(child: Text("${this.name.capitalize()}"))), diff --git a/lib/entities/PizzaRecipe/Ingredients.dart b/lib/entities/PizzaRecipe/Ingredients.dart index e8d6920..979d5e8 100644 --- a/lib/entities/PizzaRecipe/Ingredients.dart +++ b/lib/entities/PizzaRecipe/Ingredients.dart @@ -7,28 +7,26 @@ class Ingredients { Ingredients(this.ingredients, this.method); - Widget getIngredientsWidget(int pizzaCount, int doughBallSize) { - return Container( - child: Table( - border: TableBorder.all(), - columnWidths: const { - 0: FlexColumnWidth(2), - 1: FlexColumnWidth(2), - 2: FlexColumnWidth(2), - }, - children: - [ - TableRow( - children: [ - TableCell(child: Center(child: Text("Ingredient"))), - TableCell(child: Center(child: Text("Single Ball"))), - TableCell(child: Center(child: Text("Total"))), - ] - ) + Table getIngredientsTable(int pizzaCount, int doughBallSize) { + return Table( + border: TableBorder.all(), + columnWidths: const { + 0: FlexColumnWidth(2), + 1: FlexColumnWidth(2), + 2: FlexColumnWidth(2), + }, + children: + [ + TableRow( + children: [ + TableCell(child: Center(child: Text("Ingredient"))), + TableCell(child: Center(child: Text("Single Ball"))), + TableCell(child: Center(child: Text("Total"))), + ] + ) - ] + - ingredients.values.map((ingredient) => ingredient.getIngredientWidget(pizzaCount, doughBallSize)).toList() - ) + ] + + ingredients.values.map((ingredient) => ingredient.getIngredientTableRow(pizzaCount, doughBallSize)).toList() ); } } \ No newline at end of file diff --git a/lib/entities/PizzaRecipe/PizzaRecipe.dart b/lib/entities/PizzaRecipe/PizzaRecipe.dart index 9b2bb8d..5d68d0c 100644 --- a/lib/entities/PizzaRecipe/PizzaRecipe.dart +++ b/lib/entities/PizzaRecipe/PizzaRecipe.dart @@ -17,7 +17,7 @@ class PizzaRecipe { PizzaRecipe(this.name, this.description, this.ingredients, this.recipeSteps); Widget getIngredientsWidget(int pizzaCount, int doughBallSize){ - return ingredients.getIngredientsWidget(pizzaCount, doughBallSize); + return ingredients.getIngredientsTable(pizzaCount, doughBallSize); } static Future fromYaml(yamlPath) async{