fetchMoreRequest method

  1. @override
Future<RequestType> fetchMoreRequest()
override

This method defines the way we determine whether our current request has more data to fetch.

Implementation

@override
Future<RequestType> fetchMoreRequest() async {
  // get current params
  final currentParams = await request.getParams();

  // get the next page
  final nextPage =
      int.parse(currentParams[paginationProperty()] ?? firstPage.toString()) +
          1;

  request.overwriteParams = {
    paginationProperty(): nextPage.toString(),
  };

  return request;
}