0

I've created PaginatedDataTable in flutter as below enter image description here

Everything works fine but I want to show this in Television and need to change Page by automatic, is there any way to do this?

user3863074
  • 115
  • 7

1 Answers1

0

I found the solution by using PaginatorController as below

  void startTimer(PaginatorController paginatorController, int duration) {
Timer.periodic(Duration(seconds: duration), (Timer t) {
  if (paginatorController.isAttached) {
    // Check if still less than row count
    if (paginatorController.currentRowIndex +
            paginatorController.rowsPerPage <
        paginatorController.rowCount) {
      paginatorController.goToNextPage();
    } else {
      // If last page go back to first page
      paginatorController.goToFirstPage();
    }
  }
});

}

user3863074
  • 115
  • 7