InfiniteQueryResult<T, PageParam> class
Result object for useInfiniteQuery hook
Constructors
-
InfiniteQueryResult({required List<
T> data, Object? error, Object? lastRefreshError, required bool isLoading, required bool isFetching, required bool isFetchingNextPage, required bool isFetchingPreviousPage, required bool isSuccess, required bool isError, required bool isStale, required bool hasNextPage, required bool hasPreviousPage, required Future<void> fetchNextPage(), required Future<void> fetchPreviousPage(), required Future<void> refetch(), required void remove(), required Future<void> refresh(), required bool isRefreshing}) -
const
-
InfiniteQueryResult.fromState(InfiniteQueryState<
T> state, {required Future<void> fetchNextPage(), required Future<void> fetchPreviousPage(), required Future<void> refetch(), required void remove(), required Future<void> refresh(), bool isRefreshing = false}) -
Create InfiniteQueryResult from InfiniteQueryState
factory
Properties
-
data
→ List<
T> -
All pages of data
final
- error → Object?
-
Current error if any
final
-
fetchNextPage
→ Future<
void> Function() -
Function to fetch next page
final
-
fetchPreviousPage
→ Future<
void> Function() -
Function to fetch previous page
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasNextPage → bool
-
Whether there is a next page
final
- hasPreviousPage → bool
-
Whether there is a previous page
final
- isEmpty → bool
-
Check if data is empty (no pages or all pages are empty)
no setter
- isError → bool
-
Whether the query has an error
final
- isFetching → bool
-
Whether the query is currently fetching (including background refetch)
final
- isFetchingNextPage → bool
-
Whether currently fetching next page
final
- isFetchingPreviousPage → bool
-
Whether currently fetching previous page
final
- isLoading → bool
-
Whether the query is currently loading
final
- isNotEmpty → bool
-
Check if data is not empty
no setter
- isRefreshing → bool
-
Whether the query is currently refreshing (pull-to-refresh)
final
- isStale → bool
-
Whether the data is stale
final
- isSuccess → bool
-
Whether the query was successful
final
- lastRefreshError → Object?
-
Last refresh error (even when showing cached data)
final
-
refetch
→ Future<
void> Function() -
Function to manually refetch all pages
final
-
refresh
→ Future<
void> Function() -
Function to refresh data (clears cache and refetches from first page)
This is ideal for pull-to-refresh functionality
final
- remove → void Function()
-
Function to remove from cache
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
flatData<
E> () → List< E> - Convenience getter to access all items flattened from all pages This is particularly useful when T is List
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited