cached_query_flutter library

Classes

CachedQuery
CachedQuery is a singleton that keeps track of all the cached queries
InfiniteQuery<T, A>
InfiniteQuery caches a series of Query's for use in an infinite list.
InfiniteQueryBuilder<T, A>
Listen to changed in an InfiniteQuery and build the ui with the result.
InfiniteQueryState<T>
InfiniteQueryState holds the current state of an InfiniteQuery
Mutation<T, A>
{@template mutation} Mutation is used to create, update and delete data from an asynchronous source.
MutationBuilder<T, A>
Listen to changes in an Mutation and build the ui with the result.
MutationState<T>
MutationState holds the current state of an InfiniteQuery.
Query<T>
Query is will fetch and cache the response of the queryFn.
QueryBase<T, State extends QueryState>
An Interface for both Query and InfiniteQuery.
QueryBuilder<T>
Listen to changes in an Mutation and build the ui with the result.
QueryConfig
Global config for all queries and infinite queries.
QueryConfigFlutter
Query config including flutter options
QueryObserver
Query Observer
QueryState<T>
QueryState holds the current state of a Query
StateBase
An Interface for both QueryState and InfiniteQueryState.
StorageInterface
An interface for any storage adapter.

Enums

QueryStatus
Generic status of a query or mutation.
RefetchReason
The reason the cache is being refetched.

Extensions

CachedQueryExt on CachedQuery
Flutter specific extension on CachedQuery

Typedefs

GetNextArg<T, A> = A? Function(InfiniteQueryState<T>)
Determines the parameters of the next page in an infinite query.
InfiniteQueryBuilderFunc<T, A> = Widget Function(BuildContext context, InfiniteQueryState<T> state, InfiniteQuery<T, A> query)
The builder function is called on each widget build.
InfiniteQueryFunc<T, A> = Future<T> Function(A)
The result of the InfiniteQueryFunc will be cached.
KeyFilterFunc = bool Function(Object unencodedKey, String key)
Used to match multiple queries.
MutationBuilderCallback<T, A> = Widget Function(BuildContext context, MutationState<T> state, Future<T?> mutate(A args))
Listen to changes in an Mutation and build the ui with the result.
MutationQueryCallback<T, A> = Future<T> Function(A arg)
The asynchronous query function.
OnErrorCallback<A> = FutureOr<void> Function(A arg, Object error, Object? fallback)
Called when the queryFn as completed with an error.
OnInfiniteQueryErrorCallback<T> = void Function(dynamic)
On success is called when the query function is executed successfully.
OnInfiniteQuerySuccessCallback<T> = void Function(T)
On success is called when the query function is executed successfully.
OnQueryErrorCallback<T> = void Function(dynamic)
On success is called when the query function is executed successfully.
OnQuerySuccessCallback<T> = void Function(T)
On success is called when the query function is executed successfully.
OnStartMutateCallback<A> = FutureOr Function(A arg)
Called when Mutation has started.
OnSuccessCallback<T, A> = FutureOr<void> Function(T res, A arg)
Called when the queryFn as completed with no error.
QueryFunc<T> = Future<T> Function()
The result of the QueryFunc will be cached.
Serializer = dynamic Function(dynamic json)
Used to serialize the query data when fetched from local storage.
UpdateFunc<T> = T? Function(T? oldData)
Update function used to update the data in a query.
WhereCallback = bool Function(QueryBase)
Should return true if a condition is met.