CachedQuery class

CachedQuery is a singleton that keeps track of all the cached queries

Available Extensions

Constructors

CachedQuery.asNewInstance()
Allow the creation of new instances for testing purposes
factory

Properties

defaultConfig QueryConfig
The current global config that is set.
no setter
hashCode int
The hash code for this object.
no setterinherited
isConfigSet bool
Whether global configs have been set.
no setter
observers List<QueryObserver>
The current query observer.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
storage StorageInterface?
Get the current storage interface.
no setter

Methods

addQuery(QueryBase query) → void
Add a query to the cache.
config({StorageInterface? storage, QueryConfig? config, List<QueryObserver>? observers}) → void
Set the global default config which all queries will use.
deleteCache({Object? key, bool deleteStorage = false, KeyFilterFunc? filterFn}) → void
Delete cache currently stored.
getQuery(Object key) QueryBase?
Get a Query at a given key.
invalidateCache({Object? key, KeyFilterFunc? filterFn}) → void
Invalidate cache currently stored.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refetchQueries({KeyFilterFunc? filterFn, List<Object>? keys}) → void
Refetch multiple queries.
reset() → void
Reset the singleton back to default settings.
toString() String
A string representation of this object.
inherited
updateInfiniteQuery<Data>({Object? key, KeyFilterFunc? filterFn, required UpdateFunc<List<Data>> updateFn}) → void
Update the data of an InfiniteQuery at a given key.
updateQuery({Object? key, KeyFilterFunc? filterFn, required UpdateFunc updateFn}) → void
Update the data of an Query at a given key.
whereQuery(WhereCallback findCallback) List<QueryBase>?
Find and return a list of Query's matching a given condition.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance CachedQuery
Get the singleton instance of CachedQuery.
final