StreamNotifier<ValueT> class abstract Notifiers

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.

Inheritance

Constructors

StreamNotifier()

Properties

future → Future<ValueT>
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 → Ref
The Ref associated with this notifier.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
state ↔ AsyncValue<ValueT>
The value currently exposed by this notifier.
getter/setter pairinherited

Methods

build() → Stream<ValueT>
Initialize an AsyncNotifier.
listenSelf(void listener(AsyncValue<ValueT>? previous, AsyncValue<ValueT> next), {void onError(Object error, StackTrace stackTrace)?}) → RemoveListener
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
runBuild() → WhenComplete?
Executes Notifier.build.
override
toString() → String
A string representation of this object.
inherited
update(FutureOr<ValueT> cb(ValueT previousState), {FutureOr<ValueT> onError(Object err, StackTrace stackTrace)?}) → Future<ValueT>
A function to update state from its previous value, while abstracting loading/error cases for state.
inherited
updateShouldNotify(AsyncValue<ValueT> previous, AsyncValue<ValueT> next) → bool
A method invoked when the state exposed by this Notifier changes. It compares the previous and new value, and return whether listeners should be notified.
inherited

Operators

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