GetNextPageParamFn<TPage, TParam> typedef
GetNextPageParamFn<TPage, TParam> =
TParam? Function(TPage lastPage, List<TPage> allPages)
Function signature for deriving the next page parameter from the lastPage and allPages.
Returns null when there are no further pages available.
GetNextPageParamFn<List<Post>, int> getNextPage = (lastPage, allPages) =>
lastPage.isNotEmpty ? allPages.length + 1 : null;
Implementation
typedef GetNextPageParamFn<TPage, TParam> = TParam? Function(
TPage lastPage,
List<TPage> allPages,
);