AsyncValue<T> class
sealed
Represents the state of an asynchronous operation.
- Implementers
Constructors
- AsyncValue.data(T value)
-
Creates an AsyncData with the provided
value.constfactory - AsyncValue.error(Object error, [StackTrace? stackTrace])
-
Creates an AsyncError state with the provided
errorand optionalstackTrace.constfactory - AsyncValue.loading()
-
Creates an AsyncLoading state.
constfactory
Properties
- hasError → bool
-
Whether this state is AsyncError.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasValue → bool
-
Whether this state is AsyncData.
no setter
- isLoading → bool
-
Whether this state is AsyncLoading.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- valueOrNull → T?
-
The value of type
Tif this is AsyncData, otherwise null.no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
R> ({required R data(T data), required R loading(), required R error(Object error, StackTrace? stackTrace)}) → R - Maps the current state to a value or widget based on the subclass type.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited