buildGetNextPageParameters method

  1. @override
ListInsurance buildGetNextPageParameters(
  1. List<Insurance>? currentPageItems,
  2. {int? pageSize}
)

Builds the ListParametersType-type parameter set to use to retrieve the next page of a PaginatedCollection. This method should be overridden by subclasses to provide the appropriate parameters for the next page request.

Implementation

@override
ListInsurance buildGetNextPageParameters(List<Insurance>? currentPageItems,
    {int? pageSize}) {
  ListInsurance parameters = filters ?? ListInsurance();

  parameters.beforeId = currentPageItems?.last.id;

  if (pageSize != null) {
    parameters.pageSize = pageSize;
  }

  return parameters;
}