flutter_data library

Classes

AlwaysAliveRefreshable<T>
An interface for provider expressions that can be passed to ref.refresh
AsyncData<T>
Creates an AsyncValue with a data.
AsyncError<T>
Creates an AsyncValue in the error state.
AsyncLoading<T>
Creates an AsyncValue in loading state.
AsyncNotifier<State>
A Notifier implementation that is asynchronously initialized.
AsyncNotifierProviderElement<NotifierT extends AsyncNotifierBase<T>, T>
The element of AsyncNotifierProvider.
AsyncNotifierProviderElementBase<NotifierT extends AsyncNotifierBase<T>, T>
The element of AsyncNotifierProvider.
AsyncNotifierProviderFamily<NotifierT extends FamilyAsyncNotifier<T, Arg>, T, Arg>
The Family of AsyncNotifierProvider.
AsyncNotifierProviderRef<T>
An object used by providers to interact with other providers and the life-cycles of the application.
AsyncValue<T>
A utility for safely manipulating asynchronous data.
AutoDisposeAsyncNotifier<State>
A provider which creates and listen to an AsyncNotifier.
AutoDisposeAsyncNotifierProviderElement<NotifierT extends AsyncNotifierBase<T>, T>
The element of AutoDisposeAsyncNotifierProvider.
AutoDisposeAsyncNotifierProviderFamily<NotifierT extends AutoDisposeFamilyAsyncNotifier<T, Arg>, T, Arg>
The Family of AsyncNotifierProvider.
AutoDisposeAsyncNotifierProviderRef<T>
An object used by providers to interact with other providers and the life-cycles of the application.
AutoDisposeFamilyAsyncNotifier<State, Arg>
A provider which creates and listen to an AsyncNotifier.
AutoDisposeFamilyNotifier<State, Arg>
A class which exposes a state that can change over time.
AutoDisposeFamilyStreamNotifier<State, Arg>
A variant of AsyncNotifier which has build creating a Stream.
AutoDisposeFutureProvider<T>
A provider that asynchronously creates a value.
AutoDisposeFutureProviderElement<T>
The ProviderElementBase of AutoDisposeFutureProvider
AutoDisposeFutureProviderFamily<R, Arg>
The Family of an AutoDisposeFutureProvider
AutoDisposeFutureProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
AutoDisposeNotifier<State>
A class which exposes a state that can change over time.
AutoDisposeNotifierProviderElement<NotifierT extends NotifierBase<T>, T>
The element of AutoDisposeNotifierProvider
AutoDisposeNotifierProviderFamily<NotifierT extends AutoDisposeFamilyNotifier<T, Arg>, T, Arg>
The Family of NotifierProvider.
AutoDisposeNotifierProviderRef<T>
An object used by providers to interact with other providers and the life-cycles of the application.
AutoDisposeProvider<T>
A provider that exposes a read-only value.
AutoDisposeProviderElement<T>
The element of AutoDisposeProvider
AutoDisposeProviderFamily<R, Arg>
The Family of AutoDisposeProvider
AutoDisposeProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
AutoDisposeRef<State>
A Ref for providers that are automatically destroyed when no longer used.
AutoDisposeStateNotifierProvider<NotifierT extends StateNotifier<T>, T>
Creates a StateNotifier and exposes its current state.
AutoDisposeStateNotifierProviderElement<NotifierT extends StateNotifier<T>, T>
The element of AutoDisposeStateNotifierProvider.
AutoDisposeStateNotifierProviderFamily<NotifierT extends StateNotifier<T>, T, Arg>
The Family of AutoDisposeStateNotifierProvider.
AutoDisposeStateNotifierProviderRef<NotifierT extends StateNotifier<T>, T>
An object used by providers to interact with other providers and the life-cycles of the application.
AutoDisposeStateProvider<T>
A provider that exposes a value that can be modified from outside.
AutoDisposeStateProviderElement<T>
The element of StateProvider.
AutoDisposeStateProviderFamily<R, Arg>
The Family of StateProvider.
AutoDisposeStateProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
AutoDisposeStreamNotifier<State>
A variant of AsyncNotifier which has build creating a Stream.
AutoDisposeStreamNotifierProviderElement<NotifierT extends AsyncNotifierBase<T>, T>
The element of AutoDisposeStreamNotifierProvider.
AutoDisposeStreamNotifierProviderFamily<NotifierT extends AutoDisposeFamilyStreamNotifier<T, Arg>, T, Arg>
The Family of StreamNotifierProvider.
AutoDisposeStreamNotifierProviderRef<T>
An object used by providers to interact with other providers and the life-cycles of the application.
AutoDisposeStreamProvider<T>
Creates a stream and exposes its latest event.
AutoDisposeStreamProviderElement<T>
The element of AutoDisposeStreamProvider.
AutoDisposeStreamProviderFamily<R, Arg>
The Family of AutoDisposeStreamProvider.
AutoDisposeStreamProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
BelongsTo<E extends DataModelMixin<E>>
A Relationship that models a to-one ownership.
DataFinder
DataGraphEvent
DataHelpers
DataModel<T extends DataModel<T>>
DataRelationship
DataRepository
Annotation on a DataModelMixin model to request a Repository be generated for it.
DataRequestLabel
Data request information holder.
DataResponse
DataState<T>
DataStateNotifier<T>
DelayedStateNotifier<T>
DeserializedData<T extends DataModelMixin<T>>
A utility class used to return deserialized main models AND included models.
FamilyAsyncNotifier<State, Arg>
A Notifier implementation that is asynchronously initialized.
FamilyNotifier<State, Arg>
A class which exposes a state that can change over time.
FamilyStreamNotifier<State, Arg>
A variant of AsyncNotifier which has build creating a Stream.
FutureProvider<T>
A provider that asynchronously creates a value.
FutureProviderElement<T>
The element of a FutureProvider
FutureProviderFamily<R, Arg>
The Family of a FutureProvider
FutureProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
GraphNotifier
A bidirected graph data structure that notifies modification events through a StateNotifier.
HasMany<E extends DataModelMixin<E>>
A Relationship that models a to-many ownership.
HiveLocalAdapter<T extends DataModelMixin<T>>
Hive implementation of LocalAdapter and Hive's TypeAdapter.
HiveLocalStorage
InternalHolder<T extends DataModelMixin<T>>
A object which maintains a provider alive.
LocalAdapter<T extends DataModelMixin<T>>
An adapter interface to access local storage.
Notifier<State>
A class which exposes a state that can change over time.
NotifierProviderElement<NotifierT extends NotifierBase<T>, T>
The element of NotifierProvider.
NotifierProviderFamily<NotifierT extends FamilyNotifier<T, Arg>, T, Arg>
The Family of NotifierProvider.
NotifierProviderRef<T>
An object used by providers to interact with other providers and the life-cycles of the application.
OfflineOperation<T extends DataModelMixin<T>>
Represents an offline request that is pending to be retried.
Override
An object used by ProviderContainer/ProviderScope to override the behavior of a provider/family for part of the application.
Provider<State>
A provider that exposes a read-only value.
ProviderBase<State>
A base class for all providers.
ProviderContainer
An object that stores the state of the providers and allows overriding the behavior of a specific provider.
ProviderElement<State>
A provider that exposes a read-only value.
ProviderElementBase<State>
An internal class that handles the state of a provider.
ProviderFamily<R, Arg>
The Family of Provider
ProviderObserver
An object that listens to the changes of a ProviderContainer.
ProviderOrFamily
A common interface shared by ProviderBase and Family
ProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
ProviderSubscription<State>
Represents the subscription to a ProviderListenable
Ref<State extends Object?>
An object used by providers to interact with other providers and the life-cycles of the application.
Refreshable<T>
An interface for provider expressions that can be passed to ref.refresh
Relationship<E extends DataModelMixin<E>, N>
A Set that models a relationship between one or more DataModelMixin objects and their a DataModelMixin owner. Backed by a GraphNotifier.
RelationshipGraphNode<T extends DataModelMixin<T>>
RelationshipMeta<T extends DataModelMixin<T>>
RemoteAdapter<T extends DataModelMixin<T>>
An adapter base class for all remote operations for type T.
Repository<T extends DataModelMixin<T>>
Repository is the API used to interact with models whether local or remote.
RepositoryInitializer
StateController<T>
A StateNotifier that allows modifying its state from outside.
StateNotifier<T>
An observable class that stores a single immutable state.
StateNotifierProvider<NotifierT extends StateNotifier<T>, T>
Creates a StateNotifier and exposes its current state.
StateNotifierProviderElement<NotifierT extends StateNotifier<T>, T>
The element of StateNotifierProvider.
StateNotifierProviderFamily<NotifierT extends StateNotifier<T>, T, Arg>
The Family of StateNotifierProvider.
StateNotifierProviderRef<NotifierT extends StateNotifier<T>, T>
An object used by providers to interact with other providers and the life-cycles of the application.
StateProvider<T>
A provider that exposes a value that can be modified from outside.
StateProviderElement<T>
The element of StateProvider.
StateProviderFamily<R, Arg>
The Family of StateProvider.
StateProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
StreamNotifier<State>
A variant of AsyncNotifier which has build creating a Stream.
StreamNotifierProviderElement<NotifierT extends AsyncNotifierBase<T>, T>
The element of StreamNotifierProvider.
StreamNotifierProviderFamily<NotifierT extends FamilyStreamNotifier<T, Arg>, T, Arg>
The Family of StreamNotifierProvider.
StreamNotifierProviderRef<T>
An object used by providers to interact with other providers and the life-cycles of the application.
StreamProvider<T>
Creates a stream and exposes its latest event.
StreamProviderElement<T>
The element of StreamProvider.
StreamProviderFamily<R, Arg>
The Family of StreamProvider.
StreamProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
WatchArgs<T extends DataModelMixin<T>>
This argument holder class is used internally with Riverpod familys.

Mixins

AlwaysAliveProviderBase<State>
A base class for providers that never dispose themselves.
AlwaysAliveProviderListenable<State>
A base class for all providers, used to consume a provider.
DataModelMixin<T extends DataModelMixin<T>>
Data classes extending this class are marked to be managed through Flutter Data.
NothingMixin
OverrideWithValueMixin<State>
A mixin to add overrideWithValue capability to a provider.
ProviderListenable<State>
A base class for all providers, used to consume a provider.

Extensions

AsyncValueX
An extension that adds methods like when to an AsyncValue.
DataGraphEventTypeX
DataModelExtension
Extension that adds syntax-sugar to data classes, linking them to common Repository methods such as save and delete.
DataModelRelationshipExtension
DataStateNotifierListX
Functional utilities for DataStateNotifier
DataStateNotifierX
Functional utilities for DataStateNotifier
DeleteAllX
IterableNullX
IterableRelationshipExtension
IterableX
MapUtilsX
OfflineOperationsX
OverrideWithProviderExtension
A mixin to add overrideWithProvider capability to providers.
StateNotifierX
Functional utilities for StateNotifier
StringUtilsX
UriUtilsX

Constants

stamp → const _Stamp
_Stamp()

Properties

backoffFn int Function(int i)
final
graphNotifierProvider Provider<GraphNotifier>
final
graphNotifierThrottleDurationProvider Provider<Duration>
final
hiveLocalStorageProvider Provider<HiveLocalStorage>
final
hiveProvider Provider<HiveInterface>
final
httpClientProvider Provider<Client?>
When this provider is non-null it will override all _RemoteAdapter.httpClient overrides; it is useful for providing a mock client for testing
final
internalRepositories Map<String, Repository<DataModelMixin>>
ONLY FOR FLUTTER DATA INTERNAL USE
final
offlineRetryProvider StreamProvider<void>
final

Functions

describeIdentity(Object? object) String
Returns a summary of the runtime type and hash code of object.
shortHash(Object? object) String
Object.hashCode's 20 least-significant bits.

Typedefs

AlsoWatch<T extends DataModelMixin<T>> = Iterable<RelationshipGraphNode<DataModelMixin>> Function(RelationshipGraphNode<T>)
AsyncNotifierFamilyProvider<NotifierT extends FamilyAsyncNotifier<T, Arg>, T, Arg> = FamilyAsyncNotifierProviderImpl<NotifierT, T, Arg>
A provider which creates and listen to an AsyncNotifier.
AsyncNotifierProvider<NotifierT extends AsyncNotifier<T>, T> = AsyncNotifierProviderImpl<NotifierT, T>
A provider which creates and listen to an AsyncNotifier.
AutoDisposeAsyncNotifierProvider<NotifierT extends AutoDisposeAsyncNotifier<T>, T> = AutoDisposeAsyncNotifierProviderImpl<NotifierT, T>
A provider which creates and listen to an AsyncNotifier.
AutoDisposeFamilyAsyncNotifierProvider<NotifierT extends AutoDisposeFamilyAsyncNotifier<T, Arg>, T, Arg> = AutoDisposeFamilyAsyncNotifierProviderImpl<NotifierT, T, Arg>
A provider which creates and listen to an AsyncNotifier.
AutoDisposeFamilyNotifierProvider<NotifierT extends AutoDisposeFamilyNotifier<T, Arg>, T, Arg> = AutoDisposeFamilyNotifierProviderImpl<NotifierT, T, Arg>
A Provider which exposes a Notifier and listens to it.
AutoDisposeFamilyStreamNotifierProvider<NotifierT extends AutoDisposeFamilyStreamNotifier<T, Arg>, T, Arg> = AutoDisposeFamilyStreamNotifierProviderImpl<NotifierT, T, Arg>
AutoDisposeNotifierProvider<NotifierT extends AutoDisposeNotifier<T>, T> = AutoDisposeNotifierProviderImpl<NotifierT, T>
A Provider which exposes a Notifier and listens to it.
AutoDisposeStreamNotifierProvider<NotifierT extends AutoDisposeStreamNotifier<T>, T> = AutoDisposeStreamNotifierProviderImpl<NotifierT, T>
ConfigureRepositoryLocalStorage = Override Function({FutureFn<String>? baseDirFn, LocalStorageClearStrategy? clear, List<int>? encryptionKey})
DataFinderAll<T extends DataModelMixin<T>> = Future<List<T>> Function({bool? background, Map<String, String>? headers, DataRequestLabel? label, OnErrorAll<T>? onError, OnSuccessAll<T>? onSuccess, Map<String, dynamic>? params, bool? remote, bool? syncLocal})
DataFinderOne<T extends DataModelMixin<T>> = Future<T?> Function(Object model, {bool? background, Map<String, String>? headers, DataRequestLabel? label, OnErrorOne<T>? onError, OnSuccessOne<T>? onSuccess, Map<String, dynamic>? params, bool? remote})
DataWatcherAll<T extends DataModelMixin<T>> = DataStateNotifier<List<T>> Function({String? finder, Map<String, String>? headers, DataRequestLabel? label, Map<String, dynamic>? params, bool? remote, bool? syncLocal})
DataWatcherOne<T extends DataModelMixin<T>> = DataStateNotifier<T?> Function(Object model, {AlsoWatch<T>? alsoWatch, String? finder, Map<String, String>? headers, DataRequestLabel? label, Map<String, dynamic>? params, bool? remote})
ErrorListener = void Function(Object error, StackTrace? stackTrace)
A callback that can be passed to StateNotifier.onError.
FutureFn<R> = FutureOr<R> Function()
Locator = T Function<T>()
A function that allows obtaining other objects.
NotifierFamilyProvider<NotifierT extends FamilyNotifier<T, Arg>, T, Arg> = FamilyNotifierProviderImpl<NotifierT, T, Arg>
The provider for NotifierProviderFamily.
NotifierProvider<NotifierT extends Notifier<T>, T> = NotifierProviderImpl<NotifierT, T>
A Provider which exposes a Notifier and listens to it.
OnErrorAll<T extends DataModelMixin<T>> = FutureOr<List<T>> Function(DataException e, DataRequestLabel label, RemoteAdapter<T> adapter)
OnErrorOne<T extends DataModelMixin<T>> = FutureOr<T?> Function(DataException e, DataRequestLabel label, RemoteAdapter<T> adapter)
OnSuccessAll<T extends DataModelMixin<T>> = FutureOr<List<T>> Function(DataResponse response, DataRequestLabel label, RemoteAdapter<T> adapter)
OnSuccessOne<T extends DataModelMixin<T>> = FutureOr<T?> Function(DataResponse response, DataRequestLabel label, RemoteAdapter<T> adapter)
RemoveListener = void Function()
A callback that can be used to remove a listener added with StateNotifier.addListener.
RepositoryInitializerProvider = FutureProvider<RepositoryInitializer> Function({int logLevel, bool? remote})
StreamNotifierFamilyProvider<NotifierT extends FamilyStreamNotifier<T, Arg>, T, Arg> = FamilyStreamNotifierProviderImpl<NotifierT, T, Arg>
A variant of AsyncNotifier which has build creating a Stream.
StreamNotifierProvider<NotifierT extends StreamNotifier<T>, T> = StreamNotifierProviderImpl<NotifierT, T>
A variant of AsyncNotifier which has build creating a Stream.
Watcher = W Function<W>(ProviderListenable<W> provider)

Exceptions / Errors

CircularDependencyError
An error thrown when a call to Ref.read/Ref.watch leads to a provider depending on itself.
DataException
DependencyNotFoundException<T>
Thrown when tried to call LocatorMixin.read<T>(), but the T was not found.s
OfflineException
StateNotifierListenerError
An error thrown when tried to update the state of a StateNotifier, but at least of the listeners threw.