ingredients widget is now a Table

This commit is contained in:
broodjeaap89 2021-07-11 14:26:27 +02:00
parent a5df4a0d8a
commit e4a7a8d03e

View file

@ -9,24 +9,26 @@ class Ingredients {
Table getIngredientsTable(int pizzaCount, int doughBallSize) { Table getIngredientsTable(int pizzaCount, int doughBallSize) {
return Table( return Table(
border: TableBorder.all(), border: TableBorder.all(),
columnWidths: const <int, TableColumnWidth>{ columnWidths: const <int, TableColumnWidth>{
0: FlexColumnWidth(2), 0: FlexColumnWidth(2),
1: FlexColumnWidth(2), 1: FlexColumnWidth(2),
2: FlexColumnWidth(2), 2: FlexColumnWidth(2),
}, },
children: children:
<TableRow>[ <TableRow>[
TableRow( TableRow(
children: <TableCell>[ children: <TableCell>[
TableCell(child: Center(child: Text("Ingredient"))), TableCell(child: Center(child: Text("Ingredient"))),
TableCell(child: Center(child: Text("Single Ball"))), TableCell(child: Center(child: Text("Single Ball"))),
TableCell(child: Center(child: Text("Total"))), TableCell(child: Center(child: Text("Total"))),
] ]
) )
] + ] +
ingredients.values.map((ingredient) => ingredient.getIngredientTableRow(pizzaCount, doughBallSize)).toList() ingredients.values.map((ingredient) =>
ingredient.getIngredientTableRow(pizzaCount, doughBallSize))
.toList()
); );
} }
} }