useInfiniteQuery<T, PageParam> function
UseInfiniteQuery<T, PageParam>
useInfiniteQuery<T, PageParam>(
- List<
Object> queryKey, - Future<
T> fetcher({- PageParam? pageParam,
- PageParam? getNextPageParam(
- T lastPage,
- List<
T> allPages
- PageParam? getPreviousPageParam(
- T lastPage,
- List<
T> allPages
- InfiniteQueryOptions<
T, PageParam> ? options, - required Widget builder(
- BuildContext context,
- InfiniteQueryResult<
T, PageParam> result
Convenience function to create UseInfiniteQuery widget
Implementation
UseInfiniteQuery<T, PageParam> useInfiniteQuery<T, PageParam>(
List<Object> queryKey,
Future<T> Function({PageParam? pageParam}) fetcher, {
PageParam? Function(T lastPage, List<T> allPages)? getNextPageParam,
PageParam? Function(T firstPage, List<T> allPages)? getPreviousPageParam,
InfiniteQueryOptions<T, PageParam>? options,
required Widget Function(
BuildContext context,
InfiniteQueryResult<T, PageParam> result,
)
builder,
}) {
final queryOptions =
options?.copyWith(
queryKey: queryKey,
queryFn: fetcher,
getNextPageParam: getNextPageParam,
getPreviousPageParam: getPreviousPageParam,
) ??
InfiniteQueryOptions<T, PageParam>(
queryKey: queryKey,
queryFn: fetcher,
getNextPageParam: getNextPageParam,
getPreviousPageParam: getPreviousPageParam,
);
return UseInfiniteQuery<T, PageParam>(
options: queryOptions,
builder: builder,
);
}