AsyncData<T> class final

A successfully resolved state carrying the produced value.

Implemented types

Constructors

AsyncData(T value)
Creates an AsyncData state with the given value.
const

Properties

errorOrNull Object?
The contained error, or null if this is not AsyncError.
no setteroverride
hashCode int
The hash code for this object.
no setteroverride
hasValue bool
true when a value is available — i.e. for AsyncData and AsyncRefreshing.
no setteroverride
isData bool
true only when this is an AsyncData state.
no setteroverride
isError bool
true only when this is an AsyncError state.
no setteroverride
isLoading bool
true only when this is an AsyncLoading state.
no setteroverride
isRefreshing bool
true only 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 null if this is not AsyncData or AsyncRefreshing.
no setteroverride

Methods

map<R>(R transform(T value)) AsyncState<R>
Transforms the contained value with transform when 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 orElse fallback 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