StreamNotifier<State> class abstract

A variant of AsyncNotifier which has build creating a Stream.

This can be considered as a StreamProvider that can mutate its value over time.

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.

This can be considered as a StreamProvider that can mutate its value over time. When using autoDispose or family, your notifier type changes. Instead of extending StreamNotifier, you should extend either:

Constructors

StreamNotifier()

Properties

future Future<State>
Obtains a Future that resolves with the first state value that is not AsyncLoading.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
ref StreamNotifierProviderRef<State>
The Ref from the provider associated with this AsyncNotifier.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state AsyncValue<State>
The value currently exposed by this AsyncNotifier.
getter/setter pairinherited

Methods

build() Stream<State>
Initialize an AsyncNotifier.
listenSelf(void listener(AsyncValue<State>? previous, AsyncValue<State> next), {void onError(Object error, StackTrace stackTrace)?}) → void
Listens to changes on the value exposed by this provider.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
update(FutureOr<State> cb(State), {FutureOr<State> onError(Object err, StackTrace stackTrace)?}) Future<State>
A function to update state from its previous value, while abstracting loading/error cases for state.
inherited
updateShouldNotify(AsyncValue<State> previous, AsyncValue<State> next) bool
A method invoked when the state exposed by this AsyncNotifier changes.
inherited

Operators

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