AsyncProvider<T> class
- Inheritance
-
- Object
- ProviderBase<
AsyncValue< T> > - AsyncProvider
- Available extensions
Constructors
-
AsyncProvider(FutureOr<
T> builder(Ref<AsyncValue< ref), {bool autoDispose = false, Duration autoDisposeDelay = Duration.zero, String? name})T> > -
Riverpod-compatible constructor:
AsyncProvider((ref) async => value, ...). - AsyncProvider.args(Record? _args, {bool autoDispose = false, Duration autoDisposeDelay = Duration.zero, String? name})
-
Constructor for subclasses:
class Y extends AsyncProvider<T>.
Properties
- args → Record?
-
Arguments used to define provider identity for families.
no setteroverride
- argument → Object?
-
Exposes args for Riverpod compatibility.
no setterinherited
- autoDispose → bool
-
Whether to auto-dispose when there are no listeners.
no setteroverride
- autoDisposeDelay → Duration
-
Delay before auto-disposal when unused.
no setteroverride
-
future
→ Provider<
Future< T> > -
Provider that exposes the current future value for this async provider.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → ProviderKey
-
Creates a key from the provider type and args.
no setterinherited
- name → String?
-
Optional debug name for this provider.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
build(
Ref< AsyncValue< ref) → FutureOr<T> >T> - Builds the provider value.
-
makeData(
T value) → AsyncValue< T> - Creates a data value.
-
makeError(
Object e, StackTrace st, [T? previous]) → AsyncValue< T> - Creates an error value with optional previous data.
-
makeLoading(
[T? previous]) → AsyncValue< T> - Creates a loading value, optionally carrying a previous value.
-
makeRefreshing(
T value) → AsyncValue< T> - Creates a data value marked as refreshing.
-
mutate<
R> (MutationToken< R> token, Future<R> body(Ref<AsyncValue< ref), {Concurrency concurrency = Concurrency.concurrent}) → Call<T> >R, AsyncValue< T> > -
Runs
bodyas a tracked mutation with the giventoken. -
mutation<
R> ([Symbol? symbol]) → MutationToken< R> - Creates a mutation token owned by this provider.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
overrideWith(
dynamic override) → ProviderOverride< AsyncValue< T> > -
Available on AsyncProvider<
Creates an override for this async provider using a compatible factory.T> , provided by the AsyncProviderOverrideCompat extension -
overrideWithBuild(
AsyncValue< T> builder(Ref<AsyncValue< ref, AsyncProvider<T> >T> notifier)) → ProviderOverride<AsyncValue< T> > -
Available on AsyncProvider<
Creates an override that can access the original notifier.T> , provided by the AsyncProviderOverrideCompat extension -
overrideWithValue(
AsyncValue< T> value) → ProviderOverride<AsyncValue< T> > -
Available on AsyncProvider<
Creates an override that always returnsT> , provided by the AsyncProviderOverrideCompat extensionvalue. -
run<
R> (Future< R> body(Ref<AsyncValue< ref)) → Call<T> >R, AsyncValue< T> > -
Runs
bodyin the provider context without mutation tracking. -
toString(
) → String -
Returns a debug-friendly string for this provider.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited