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
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.
no setter
- 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
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
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