Can i ask you some question about flutter list? I have a list ([Red,White,Yellow],[40,41,42],[Small,Big]), and I want to combine to DataTable DataRow DataCell (TextFormField):
Red,40,Small
White,40,Small
Yellow,40,Small
Red,41,Small
White,41,Small
Yellow,41,Small
Red,42,Small
White,42,Small
Yellow,42,Small
Red,40,Big
White,40,Big
Yellow,40,Big
Red,41,Big
White,41,Big
Yellow,41,Big
Red,42,Big
White,42,Big
Yellow,42,Big
2
Answers
This is an example on how you use nested loop to get every combination of that three categories.
Output:
To access the color of the third element, for example, you can do this:
DataRow
. EachDataRow
will containDataCell
widgets for each value in the string. In your case, you want to useTextFormField
widgets in theDataCell
widgets. This allows the user to edit the values in the table.DataTable
.DataTable
in thebuild
method of your widget.This will create a
DataTable
where each row is editable. The user can edit the values in the table using theTextFormField
widgets.