AsyncData<T> class

The state of an AsyncValue when the asynchronous operation has completed successfully.

Inheritance

Constructors

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

Properties

data → T?
Returns the value if the state is AsyncData, otherwise null.
no setterinherited
hasData bool
Alias for hasValue.
no setterinherited
hasError bool
Returns true if the state is AsyncError.
no setterinherited
hashCode int
The hash code for this object.
no setteroverride
hasValue bool
Returns true if the state is AsyncData.
no setterinherited
isLoading bool
Returns true if the state is AsyncLoading.
no setterinherited
isRefreshing bool
Whether a loading state is refreshing previously loaded data.
no setterinherited
requireValue → T
Returns the value if the state is AsyncData, otherwise throws a StateError.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → T
The resolved value.
final
valueOrNull → T?
Returns the value if the state is AsyncData, otherwise null.
no setterinherited

Methods

map<R>({required R data(AsyncData<T> data), required R loading(AsyncLoading<T> loading), required R error(AsyncError<T> error)}) → R
Transforms the state to another type by matching the wrapper class.
override
maybeMap<R>({R data(AsyncData<T> data)?, R loading(AsyncLoading<T> loading)?, R error(AsyncError<T> error)?, required R orElse()}) → R
Transforms the state to another type by matching the wrapper class, falling back to orElse if unmatched.
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 data(T data), required R loading(), required R error(Object error, StackTrace stackTrace)}) → R
Pattern matching method to execute different callbacks depending on the current state.
override

Operators

operator ==(Object other) bool
The equality operator.
override