QueryClient class
A client for managing queries and their cache.
Constructors
- QueryClient({QueryCache? cache})
- Creates a new query client.
Properties
- cache → QueryCache
-
The cache used by this client.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clearCache(
) → void - Clears the query cache.
-
fetchQuery<
T> ({required String queryKey, required Future< T> fetcher(), Duration staleTime = Duration.zero, Duration cacheTime = const Duration(minutes: 5), int retries = 3}) → Future<T> - Fetches a query and caches the result.
-
getQueryData<
T> (String queryKey) → T? - Gets the data for a query.
-
invalidateQueries(
String queryKey) → void - Invalidates a query, causing it to be refetched.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setQueryData<
T> (String queryKey, T data) → void - Sets the data for a query.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited