loadNextPage method

Future<int> loadNextPage(
  1. int pageSize,
  2. int offset,
  3. int? columnSortIndex, {
  4. bool? sortAscending,
})

Called by the advanced datatable controll to trigger a page load

Implementation

Future<int> loadNextPage(
  int pageSize,
  int offset,
  int? columnSortIndex, {
  bool? sortAscending,
}) async {
  try {
    lastDetails = await getNextPage(
      NextPageRequest(
        pageSize,
        offset,
        columnSortIndex: columnSortIndex,
        sortAscending: sortAscending,
      ),
    );
    //If the remote source is filtered, its the important upper limit
    return lastDetails?.filteredRows ?? lastDetails?.totalRows ?? 0;
  } catch (error) {
    return Future.error(error);
  }
}