getNextPage method
- Future<
PaginatedCollection< retrieveNextPageFunction(Insurance, ListInsurance> >- ListInsurance? parameters
- List<
Insurance> ? currentPageItems, - {int? pageSize}
inherited
Retrieves the next page of a PaginatedCollection
, using the provided retrieveNextPageFunction
to retrieve the next page.
Implementation
Future<PaginatedCollection<ListObjectType, ListParametersType>> getNextPage(
Future<PaginatedCollection<ListObjectType, ListParametersType>> Function(
ListParametersType? parameters)
retrieveNextPageFunction,
List<ListObjectType>? currentPageItems,
{int? pageSize}) {
if (currentPageItems == null || currentPageItems.isEmpty) {
throw PaginationException(ErrorMessages.noMorePagesToRetrieve);
}
if (hasMore == false) {
throw throw PaginationException(ErrorMessages.noMorePagesToRetrieve);
}
ListParametersType? parameters =
buildGetNextPageParameters(currentPageItems, pageSize: pageSize);
return retrieveNextPageFunction(parameters);
}