QueryResult<T> class

Result object for useQuery hook

Constructors

QueryResult({T? data, Object? error, required bool isLoading, required bool isFetching, required bool isSuccess, required bool isError, required bool isStale, required bool hasData, required Future<void> refetch(), required void remove()})
const
QueryResult.fromState(QueryState<T> state, {required Future<void> refetch(), required void remove()})
Create QueryResult from QueryState
factory

Properties

data → T?
Current query data
final
error Object?
Current error if any
final
hasData bool
Whether there is data
final
hashCode int
The hash code for this object.
no setterinherited
isError bool
Whether the query has an error
final
isFetching bool
Whether the query is currently fetching (including background refetch)
final
isLoading bool
Whether the query is currently loading
final
isStale bool
Whether the data is stale
final
isSuccess bool
Whether the query was successful
final
refetch Future<void> Function()
Function to manually refetch
final
remove → void Function()
Function to remove from cache
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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