AsyncNotifierProvider<NotifierT extends AsyncNotifier<ValueT>, ValueT> class final Providers

A provider which creates and listen to an AsyncNotifier.

This is similar to FutureProvider but allows to perform side-effects.

The syntax for using this provider is slightly different from the others in that the provider's function doesn't receive a "ref" (and in case of family, doesn't receive an argument either). Instead the ref (and argument) are directly accessible in the associated AsyncNotifier.

Inheritance
Implemented types

Constructors

AsyncNotifierProvider(NotifierT _createNotifier(), {String? name, Iterable<ProviderOrFamily>? dependencies, bool isAutoDispose = false, Retry? retry})
A provider which creates and listen to an AsyncNotifier.

Properties

argument → Object?
If this provider was created with the .family modifier, argument is the variable that was used.
finalinherited
dependencies → Iterable<ProviderOrFamily>?
The list of providers that this provider potentially depends on.
finalinherited
from → Family?
If this provider was created with the .family modifier, from is the .family instance.
finalinherited
future → Refreshable<Future<ValueT>>
Obtains the Future representing this provider.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
isAutoDispose → bool
Whether the state associated to this provider should be disposed automatically when the provider stops being listened.
finalinherited
name → String?
A custom label for providers.
finalinherited
notifier → Refreshable<NotifierT>
no setterinherited
origin → ProviderBase<AsyncValue<ValueT>>
The provider that is overridden.
no setterinherited
retry → Retry?
The retry strategy to use when a provider fails.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
overrideWith(NotifierT create()) → Override
Override the provider with a new initialization function.
inherited
overrideWithBuild(RunNotifierBuild<NotifierT, FutureOr<ValueT>> build) → Override
Overrides the build method of a notifier, allowing you to replace the default implementation with a custom one for testing or specific use cases.
inherited
selectAsync<OutT>(OutT selector(ValueT data)) → ProviderListenable<Future<OutT>>
A variant of select for asynchronous values
inherited

Operators

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

Constants

autoDispose → const AutoDisposeAsyncNotifierProviderBuilder
Marks the provider as automatically disposed when no longer listened to.
family → const AsyncNotifierProviderFamilyBuilder
A group of providers that builds their value from an external parameter.