Hello,
I am trying to render a list dynamically but want to create a group header when a certain columns is changed:
Currently I have the floowing which works to show the list:
rows: productList.map((onechild) {
return DataRow(
cells: [
DataCell(
Container(
width: 120, child: Text(onechild.group)),
showEditIcon: false,
placeholder: false),
DataCell(
Container(width: 120, child: Text(onechild.name)),
showEditIcon: false,
placeholder: false),
DataCell(
Container(width: 120, child: Text(onechild.uom)),
showEditIcon: false,
placeholder: false),
DataCell(Checkbox(
value: onechild.active,
onChanged: (
bool value,
) {
switchActive(onechild.id);
})),
DataCell(IconButton(
icon: Icon(Icons.delete),
onPressed: () {
showAlertDialog(context, onechild);
},
))
]);
}).toList()),
I am quite fresh to Flutter and Dart. How is it possible to return two Rows for one item in my list when a group key is chaninging
Regards,
Carsten.