Remove empty rows from Flutter paginated datatable

670 Views Asked by At

enter image description here

I tried to remove empty rows per page using this reference remove empty rows.

It removes empty rows on page changes but when I try to remove rows on click using this code:

datasList.remove(datasList[index]);
notifyListeners();

I want to update the state using:

setState(() {

});

of parent class but it shows error.

It removes data but not is removing row from table.

1

There are 1 best solutions below

0
Farook On

try this one : onPageChanged: (n) {

                      if (valueResponse.length - n < rowsPerPage) {
                       setState(() {
                        rowsPerPage = tableSource.rowCount - n;

}); }

                  },