I was able to setup a DataTable to display a bunch of data. But want to navigate to another screen when a row is tapped.
Unfortunately there is no onTap callback for DataRow.
I ended up adding onTap for each DataCell which looks like a hacky solution. Is there any other way to handle this?
The onTap call in DataRow is the onSelectChanged function
DataRow(
cells: [
DataCell(Text("ID"))
,DataCell(Text("NAME"))
],
onSelectChanged: (value) {
// insert your navigation function here and use the selected value returned by the function
Navigator.of(context).pop(value);
}
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With