QueryClient class
It is used to interact with the query cache. Can also be used to configure queries on a global basis using DefaultQueryOptions.
Constructors
- QueryClient({DefaultQueryOptions? defaultQueryOptions})
Properties
- defaultQueryOptions ↔ DefaultQueryOptions
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- queryCache → QueryCache
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getQueryData<
TData> (QueryKey queryKey) → TData? -
invalidateQueries(
QueryKey key, {bool exact = false}) → void - Marks the query as stale. If the query is being used in a widget, it will be refetched, otherwise it will be refetched when it is used by a widget at a later point in time. Supports partial matching, take a look at the exact option.
-
isFetching(
) → int -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setQueryData<
TData> (QueryKey queryKey, TData updater(TData? previous)) → void -
Sets the query cache idendifiable by the given query key.
If the query data doesn't exist already in the cache (that's why
previous
is nullable), it'll be created. The type of returned data from the updater function must match the type of data stored in the cache, otherwise an error will be thrown. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited