AsyncData<T> class
final
A successfully resolved state carrying the produced value.
- Implemented types
-
- AsyncState<
T>
- AsyncState<
Properties
- errorOrNull → Object?
-
The contained error, or
nullif this is not AsyncError.no setteroverride - hashCode → int
-
The hash code for this object.
no setteroverride
- hasValue → bool
-
truewhen a value is available — i.e. for AsyncData and AsyncRefreshing.no setteroverride - isData → bool
-
trueonly when this is an AsyncData state.no setteroverride - isError → bool
-
trueonly when this is an AsyncError state.no setteroverride - isLoading → bool
-
trueonly when this is an AsyncLoading state.no setteroverride - isRefreshing → bool
-
trueonly when this is an AsyncRefreshing state.no setteroverride - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → T
-
The resolved value.
final
- valueOrNull → T
-
The contained value, or
nullif this is not AsyncData or AsyncRefreshing.no setteroverride
Methods
-
map<
R> (R transform(T value)) → AsyncState< R> -
Transforms the contained value with
transformwhen this is an AsyncData or AsyncRefreshing state.override -
maybeWhen<
R> ({required R orElse(), R loading()?, R data(T value)?, R error(Object error, StackTrace? stackTrace)?, R refreshing(T previousValue)?}) → R -
Like when, but provides an
orElsefallback for unhandled branches.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
-
when<
R> ({required R loading(), required R data(T value), required R error(Object error, StackTrace? stackTrace), R refreshing(T previousValue)?}) → R -
Exhaustively matches the current state and returns a value of type
R.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override