getNextPage method
- Future<
PaginatedCollection< retrieveNextPageFunction(EndShipper, ListEndShippers> >- ListEndShippers? parameters
- List<
EndShipper> ? 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);
}