flutter_data library

Classes

AlwaysAliveProviderBase<Created, Listened>
A base class for providers that never disposes themselves.
AsyncData<T>
AsyncError<T>
AsyncLoading<T>
AsyncValue<T>
An utility for safely manipulating asynchronous data.
AutoDisposeFutureProvider<T>
A provider that asynchronously creates a single value.
AutoDisposeFutureProviderFamily<T, A>
A class that allows building a FutureProvider from an external parameter.
AutoDisposeProvider<T>
A provider that exposes a read-only value.
AutoDisposeProviderBase<Created, Listened>
A base class for providers that destroy their state when no-longer listened.
AutoDisposeProviderElement<Created, Listened>
The ProviderElement of an AutoDisposeProviderBase.
AutoDisposeProviderFamily<T, A>
A class that allows building a Provider from an external parameter.
AutoDisposeProviderReference
A ProviderReference for providers that are automatically destroyed when no-longer used.
AutoDisposeStateNotifierProvider<Notifier extends StateNotifier<Value>, Value>
Creates a StateNotifier and expose its current state.
AutoDisposeStateNotifierProviderFamily<Notifier extends StateNotifier<Value>, Value, Param>
A class that allows building a StateNotifierProvider from an external parameter.
AutoDisposeStateProvider<T>
A provider that expose a value which can be modified from outside.
AutoDisposeStateProviderFamily<T, A>
A class that allows building a StateProvider from an external parameter.
AutoDisposeStreamProvider<T>
Creates a stream and expose its latest event.
AutoDisposeStreamProviderFamily<T, A>
A class that allows building a StreamProvider from an external parameter.
BelongsTo<E extends DataModel<E>>
A Relationship that models a to-one ownership.
DataGraphEvent
DataHelpers
DataModel<T extends DataModel<T>>
A mixin to "tag" and ensure the implementation of an id getter in data classes managed through Flutter Data.
DataRelationship
DataRepository
Annotation on a DataModel model to request a Repository be generated for it.
DataState<T>
DataStateNotifier<T>
DelayedStateNotifier<T>
DeserializedData<T, I>
A utility class used to return deserialized main models AND included models.
FutureProvider<T>
A provider that asynchronously creates a single value.
FutureProviderFamily<T, A>
A class that allows building a FutureProvider from an external parameter.
GraphNotifier
A bidirected graph data structure that notifies modification events through a StateNotifier.
HasMany<E extends DataModel<E>>
A Relationship that models a to-many ownership.
HiveLocalAdapter<T extends DataModel<T>>
Hive implementation of LocalAdapter and Hive's TypeAdapter.
HiveLocalStorage
LocalAdapter<T extends DataModel<T>>
An adapter interface to access local storage
OfflineOperation<T extends DataModel<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<T>
A provider that exposes a read-only value.
ProviderBase<Created, Listened>
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<Created, Listened>
An internal class that handles the state of a provider.
ProviderFamily<T, A>
A class that allows building a Provider from an external parameter.
ProviderListenable<Listened>
A base class for all providers, used to consume a provider.
ProviderObserver
An object that listens to the changes of a ProviderContainer.
ProviderReference
An object used by providers to interact with other providers and the life-cycles of the application.
ProviderSubscription<Listened>
An object that allows watching the state of a provider.
Relationship<E extends DataModel<E>, N>
A Set that models a relationship between one or more DataModel objects and their a DataModel owner. Backed by a GraphNotifier.
RemoteAdapter<T extends DataModel<T>>
An adapter base class for all remote operations for type T.
Repository<T extends DataModel<T>>
Thin wrapper on the RemoteAdapter API
RepositoryInitializer
RepositoryInitializerArgs
RootProvider<Created, Listened>
A base class for non-scoped providers.
ScopedProvider<Listened>
A provider that may behave differently for a specific part of the application.
StateController<T>
A StateNotifier that allows modifying its state from outside.
StateNotifier<T>
An observable class that stores a single immutable state.
StateNotifierProvider<Notifier extends StateNotifier<Value>, Value>
Creates a StateNotifier and expose its current state.
StateNotifierProviderFamily<Notifier extends StateNotifier<Value>, Value, Param>
A class that allows building a StateNotifierProvider from an external parameter.
StateProvider<T>
A provider that expose a value which can be modified from outside.
StateProviderFamily<T, A>
A class that allows building a StateProvider from an external parameter.
StreamProvider<T>
Creates a stream and expose its latest event.
StreamProviderFamily<T, A>
A class that allows building a StreamProvider from an external parameter.
StringUtils
WatchArgs<T>
This argument holder class is used internally with Riverpod familys.

Mixins

NothingMixin

Extensions

AutoDisposeStateFamilyX on Family<StateController<T>, StateController<T>, Param, AutoDisposeProviderReference, AutoDisposeStateProvider<T>>
Overrides overrideWithProvider for StateProvider.autoDispose.family.
DataGraphEventTypeX on DataGraphEventType
DataModelExtension on DataModel<T>
Extension that adds syntax-sugar to data classes, linking them to common Repository methods such as save and delete.
DataModelRelationshipExtension on DataModel<T>
FamilyX on Family<Created, Listened, Param, Ref, P>
Implements overrideWithProvider for families.
IterableNullX on Iterable<T?>
IterableRelationshipExtension on Set<T>
IterableX on Iterable<T>
MapUtilsX on Map<K, V>
OfflineOperationsX on Set<OfflineOperation<DataModel<DataModel>>>
StateFamilyX on Family<StateController<T>, StateController<T>, Param, ProviderReference, StateProvider<T>>
Overrides overrideWithProvider for StateProvider.family.
StateNotifierX on DelayedStateNotifier<T>
Functional utilities for StateNotifier
StringUtilsX on String
UriUtilsX on Uri

Constants

stamp → const _Stamp

Properties

graphNotifierProvider Provider<GraphNotifier>
final
hiveLocalStorageProvider Provider<HiveLocalStorage>
final
internalLocatorFn Repository<S> Function<S extends DataModel<S>>(RootProvider<Object, Repository<S>> provider, Reader reader)
ONLY FOR FLUTTER DATA INTERNAL USE
getter/setter pair
pendingOfflineTypesProvider StateNotifierProvider<DelayedStateNotifier<Set<String>>, Set<String>?>
Every time there is an offline operation added to/ removed from the queue, this will notify clients with all pending types (could be none) such that they can implement their own retry strategy.
final

Functions

adapterFor<T extends DataModel<T>>(T model) RemoteAdapter<DataModel>?
keyFor<T extends DataModel<T>>(T model) String?
Returns a model's _key private attribute.

Typedefs

AlsoWatch<T> = List<Relationship<DataModel, dynamic>> Function(T)
ConfigureRepositoryLocalStorage = Override Function({FutureFn<String>? baseDirFn, bool? clear, List<int>? encryptionKey})
Create<T, Ref extends ProviderReference> = T Function(Ref ref)
A callback used by providers to create the value exposed.
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.
OnData<R> = FutureOr<R> Function(R)
OnDataError<R> = FutureOr<R?> Function(DataException)
OnRawData<R> = FutureOr<R?> Function(dynamic)
Reader = T Function<T>(RootProvider<Object?, T> provider)
A function that reads the state of a provider.
RemoveListener = void Function()
A callback that can be used to remove a listener added with StateNotifier.addListener.
RepositoryInitializerProvider = FutureProvider<RepositoryInitializer> Function({bool? remote, bool? verbose})
ScopedCreate<T> = T Function(ScopedReader watch)
The function that ScopedProviders uses to create their state.
ScopedReader = T Function<T>(ProviderBase<Object?, T> provider)
A function that can both read a ScopedProvider, normal providers and a myProvider.select(..)

Exceptions / Errors

CircularDependencyError
An error thrown when a call to ProviderReference.read/ProviderReference.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
ProviderException
Encapulates an exception thrown while building a provider.
StateNotifierListenerError
An error thrown when tried to update the state of a StateNotifier, but at least of the listeners threw.