InfiniteQueryOptions<TPage, TPageParam> constructor

InfiniteQueryOptions<TPage, TPageParam>({
  1. required QueryKey<InfiniteData<TPage, TPageParam>> key,
  2. required InfinitePageFunction<TPage, TPageParam> query,
  3. required TPageParam initialPageParam,
  4. required InfiniteNextPage<TPage, TPageParam> getNextPageParam,
  5. InfinitePreviousPage<TPage, TPageParam>? getPreviousPageParam,
  6. int? maxPages,
  7. QueryPolicy policy = const QueryPolicy(),
  8. Map<String, Object?> meta = const <String, Object?>{},
})

Creates an infinite query definition.

Implementation

InfiniteQueryOptions({
  required this.key,
  required this.query,
  required this.initialPageParam,
  required this.getNextPageParam,
  this.getPreviousPageParam,
  this.maxPages,
  this.policy = const QueryPolicy(),
  this.meta = const <String, Object?>{},
}) {
  if (maxPages != null && maxPages! <= 0) {
    throw ArgumentError.value(maxPages, 'maxPages', 'Must be positive.');
  }
}