Hi there, hope you are all fine.
May you help me on how to add an Icon to a dataGridCell?
I had no problem adding Icon to a column header, but I couldn't find a way to do the same to a dataGridCell.
Adding Icon to column header:
|
@override
DataGridRowAdapter buildRow(DataGridRow row) {
return DataGridRowAdapter(cells: [
Container(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(horizontal: 16),
child: Text(row.getCells()[0].value.toString()),
),
Container(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(horizontal: 16),
child: Text(row.getCells()[1].value),
),
Container(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(horizontal: 16),
child: Text(row.getCells()[2].value.toString()),
),
Container(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(horizontal: 16),
child: Row(children: [Icon(Icons.location_on),Text(row.getCells()[3].value)],))
]);
} |
Hi there,
I can't access sample in that link. Here is the message I get: