hooks_riverpod library Null safety

Classes

AlwaysAliveProviderBase<State>
A base class for providers that never disposes themselves.
AsyncData<T>
Creates an AsyncValue with a data.
AsyncError<T>
Creates an AsyncValue in error state.
AsyncLoading<T>
Creates an AsyncValue in loading state.
AsyncValue<T>
An utility for safely manipulating asynchronous data.
AutoDisposeChangeNotifierProvider<Notifier extends ChangeNotifier?>
Creates a ChangeNotifier and subscribes to it.
AutoDisposeChangeNotifierProviderFamily<Notifier extends ChangeNotifier?, Arg>
A class that allows building a ChangeNotifierProvider from an external parameter.
AutoDisposeChangeNotifierProviderRef<Notifier>
An object used by providers to interact with other providers and the life-cycles of the application.
AutoDisposeFutureProvider<State>
A provider that asynchronously creates a single value.
AutoDisposeFutureProviderFamily<State, Arg>
A class that allows building a AutoDisposeFutureProvider from an external parameter.
AutoDisposeFutureProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
AutoDisposeProvider<State>
A provider that exposes a read-only value.
AutoDisposeProviderBase<State>
A base class for providers that destroy their state when no-longer listened.
AutoDisposeProviderElement<State>
An AutoDisposeProviderElementBase for AutoDisposeProvider
AutoDisposeProviderElementBase<State>
The ProviderElementBase of an AutoDisposeProviderBase.
AutoDisposeProviderFamily<State, Arg>
A class that allows building a Provider from an external parameter.
AutoDisposeProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
AutoDisposeRef
A Ref for providers that are automatically destroyed when no-longer used.
AutoDisposeStateNotifierProvider<Notifier extends StateNotifier<State>, State>
Creates a StateNotifier and expose its current state.
AutoDisposeStateNotifierProviderFamily<Notifier extends StateNotifier<State>, State, Arg>
A class that allows building a StateNotifierProvider from an external parameter.
AutoDisposeStateNotifierProviderRef<Notifier extends StateNotifier<State>, State>
An object used by providers to interact with other providers and the life-cycles of the application.
AutoDisposeStateProvider<State>
A provider that expose a value which can be modified from outside.
AutoDisposeStateProviderElement<State>
The ProviderElementBase for StateProvider
AutoDisposeStateProviderFamily<State, Arg>
AutoDisposeStateProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
AutoDisposeStreamProvider<State>
Creates a stream and expose its latest event.
AutoDisposeStreamProviderFamily<State, Arg>
A class that allows building a StreamProvider from an external parameter.
AutoDisposeStreamProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
ChangeNotifierProvider<Notifier extends ChangeNotifier?>
Creates a ChangeNotifier and subscribes to it.
ChangeNotifierProviderFamily<Notifier extends ChangeNotifier?, Arg>
A class that allows building a ChangeNotifierProvider from an external parameter.
ChangeNotifierProviderRef<Notifier extends ChangeNotifier?>
An object used by providers to interact with other providers and the life-cycles of the application.
Consumer
Build a widget tree while listening to providers.
ConsumerState<T extends ConsumerStatefulWidget>
A State that has access to a WidgetRef through ref, allowing it to read providers.
ConsumerStatefulElement
The Element for a ConsumerStatefulWidget
ConsumerStatefulWidget
A StatefulWidget that can read providers.
ConsumerWidget
A StatelessWidget that can listen to providers.
Family<State, Arg, FamilyProvider extends ProviderBase<State>>
A base class for all families
FamilyOverride<Arg>
Do not use: Internal object to used by ProviderContainer/ProviderScope to override the behavior of a "family" for part of the application.
FutureProvider<State>
A provider that asynchronously creates a single value.
FutureProviderFamily<State, Arg>
A class that allows building a AutoDisposeFutureProvider from an external parameter.
FutureProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
HookConsumer
A widget that can both use hooks and listen to providers.
HookConsumerWidget
A widget that can both use hooks and listen to providers.
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<State, Arg>
A class that allows building a Provider from an external parameter.
ProviderListenable<State>
A base class for all providers, used to consume a provider.
ProviderListener<T>
A widget that allows listening to a provider.
ProviderObserver
An object that listens to the changes of a ProviderContainer.
ProviderOverride
An object used by ProviderContainer to override the behavior of a provider for a part of the application.
ProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
ProviderScope
A widget that stores the state of providers.
ProviderSubscription<State>
Represents the subscription to a provider
Ref
An object used by providers to interact with other providers and the life-cycles of the application.
StateController<T>
A StateNotifier that allows modifying its state from outside.
StatefulHookConsumerWidget
A StatefulWidget that is both a ConsumerWidget and a HookWidget.
StateNotifier<T>
An observable class that stores a single immutable state.
StateNotifierProvider<Notifier extends StateNotifier<State>, State>
Creates a StateNotifier and expose its current state.
StateNotifierProviderFamily<Notifier extends StateNotifier<State>, State, Arg>
A class that allows building a StateNotifierProvider from an external parameter.
StateNotifierProviderRef<Notifier extends StateNotifier<State>, State>
An object used by providers to interact with other providers and the life-cycles of the application.
StateProvider<State>
A provider that expose a value which can be modified from outside.
StateProviderElement<State>
The ProviderElementBase for StateProvider
StateProviderFamily<State, Arg>
StateProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
StreamProvider<State>
Creates a stream and expose its latest event.
StreamProviderFamily<State, Arg>
A class that allows building a StreamProvider from an external parameter.
StreamProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
UncontrolledProviderScope
Expose a ProviderContainer to the widget tree.
WidgetRef
An object that allows widgets to interact with providers.

Mixins

AlwaysAliveProviderListenable<State>
A base class for all providers, used to consume a provider.
StateNotifierProviderOverrideMixin<Notifier extends StateNotifier<State>, State>
Add overrideWithValue to AutoDisposeStateNotifierProvider

Extensions

AlwaysAliveAsyncProviderX
Adds future and stream to providers that emit an AsyncValue
AsyncValueX
An extension that adds methods like when to an AsyncValue.
AutoDisposeAsyncProviderX
Adds future and stream to autoDispose providers that emit an AsyncValue
XAutoDisposeFamily
An extension that adds overrideWithProvider to Family.
XFamily
An extension that adds overrideWithProvider to Family.

Typedefs

ConsumerBuilder = Widget Function(BuildContext context, WidgetRef ref, Widget? child)
A function that can also listen to providers
Create<T, R extends Ref> = T Function(R 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.
FamilyCreate<T, R extends Ref, Arg> = T Function(R ref, Arg arg)
A Create equivalent used by Family.
Locator = T Function<T>()
A function that allows obtaining other objects.
OnProviderChange<T> = void Function(BuildContext context, T? previous, T value)
A function that can react to changes on a provider
ProviderReference = Ref
Alias for Ref
@Deprecated('Use Ref instead.')
Reader = T Function<T>(ProviderBase<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.
SetupOverride = void Function({required ProviderBase origin, required ProviderBase override})
An implementation detail for the override mechanism of providers

Exceptions / Errors

CircularDependencyError
An error thrown when a call to Ref.read/Ref.watch leads to a provider depending on itself.
DependencyNotFoundException<T>
Thrown when tried to call LocatorMixin.read<T>(), but the T was not found.s
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.