AsyncNotifier<T> class
abstract
A AsyncNotifier is a ChangeNotifier that wraps a BehaviorSubject.
It is useful for bridging Stream-based APIs with ChangeNotifier-based APIs.
- Inheritance
-
- Object
- ChangeNotifier
- AsyncNotifier
- Mixed-in types
Constructors
- AsyncNotifier(T _initial)
- Creates a AsyncNotifier with an initial value.
Properties
- error → Object?
-
gets the latest error
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isLoading → bool
-
gets if the async operation is loading
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stream
→ Stream<
T> -
Returns the stream of values.
latefinal
- timeout → Duration?
-
default timeout Duration for updateAsync. If null, it might leave
your future hanging
no setter
- value → T
-
Returns the current value of the stream.
no setter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object.
override
-
listenToStream<
U> (Stream< U> stream) → void -
Registers a Stream to be automatically listened to and cancelled when
the dispose method is called.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
onCreate(
) → Future< void> - override this method to perform async operations when the notifier is created
-
registerSink<
S> (Sink< S> sink) → void -
Registers a Sink to be automatically closed when the dispose method is
called.
inherited
-
registerStreamSubscription<
S> (StreamSubscription< S> subscription) → void -
Registers a StreamSubscription to be automatically cancelled when the
dispose method is called.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
T value) → void - Updates the value of the stream.
-
updateAsync(
Future< T> value()) → Future<void> - updates the async value while cancelling previous
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited