I use a PaginatedDataTable and I wish that the row been colored when selected.
I found that on simple DataTable:
DataRow(
color: MaterialStateColor.resolveWith(
(Set<MaterialState> states) => states.contains(MaterialState.selected)
? Colors.blue
: Colors.blue[400]),
selected: address.isSelected,
but nothing for PaginatedDataTable ...
Can you help me guys?
You can either set
dataTableTheme
in yourThemeData
:Or you can create a custom class that extends
DataTableSource
:And use the custom class in your
PaginatedDataTable
:You will need to have defined your
tableHeader
and your_buildCells
function. Also, I haven't yet figured out how to change the whole row color on hover, but this is at least a start for you. If anyone knows how to change the whole rows color, then this code can be improved upon.