AsyncValue<T> class sealed

A sealed class representing the state of an asynchronous operation (such as a Future or Stream).

It can be in one of three states:

Implementers

Properties

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

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.
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.
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
Pattern matching method to execute different callbacks depending on the current state.

Operators

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