AsyncData<T> class
Creates an AsyncValue with a data.
The data can be null
.
- Implemented types
-
- AsyncValue<
T>
- AsyncValue<
- Available extensions
Constructors
- AsyncData(T value)
-
Creates an AsyncValue with a data.
const
Properties
-
asData
→ AsyncData<
T> ? -
Available on AsyncValue<
Upcast AsyncValue into an AsyncData, or return null if the AsyncValue is in loading/error state.T> , provided by the AsyncValueX extensionno setter -
data
→ AsyncData<
T> ? -
Available on AsyncValue<
Upcast AsyncValue into an AsyncData, or return null if the AsyncValue is in loading/error state.T> , provided by the AsyncValueX extensionno setter - hashCode → int
-
The hash code for this object.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → T
-
The value currently exposed.
final
- value → T?
-
Available on AsyncValue<
Attempts to synchronously.T> , provided by the AsyncValueX extensionno setter
Methods
-
map<
R> ({required R data(AsyncData< T> data), required R error(AsyncError<T> error), required R loading(AsyncLoading<T> loading)}) → R -
Available on AsyncValue<
Perform some action based on the current state of the AsyncValue.T> , provided by the AsyncValueX extension -
mapOrNull<
R> ({R data(AsyncData< T> data)?, R error(AsyncError<T> error)?, R loading(AsyncLoading<T> loading)?}) → R? -
Available on AsyncValue<
Perform some actions based on the state of the AsyncValue, or return null if the current state wasn't tested.T> , provided by the AsyncValueX extension -
maybeMap<
R> ({R data(AsyncData< T> data)?, R error(AsyncError<T> error)?, R loading(AsyncLoading<T> loading)?, required R orElse()}) → R -
Available on AsyncValue<
Perform some actions based on the state of the AsyncValue, or call orElse if the current state was not tested.T> , provided by the AsyncValueX extension -
maybeWhen<
R> ({R data(T data)?, R error(Object error, StackTrace? stackTrace)?, R loading()?, required R orElse()}) → R -
Available on AsyncValue<
Switch-case over the state of the AsyncValue while purposefully not handling some cases.T> , provided by the AsyncValueX extension -
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 error(Object error, StackTrace? stackTrace), required R loading()}) → R -
Available on AsyncValue<
Performs an action based on the state of the AsyncValue.T> , provided by the AsyncValueX extension -
whenData<
R> (R cb(T value)) → AsyncValue< R> -
Available on AsyncValue<
Shorthand for when to handle only theT> , provided by the AsyncValueX extensiondata
case. -
whenOrNull<
R> ({R data(T data)?, R error(Object error, StackTrace? stackTrace)?, R loading()?}) → R? -
Available on AsyncValue<
Perform actions conditionally based on the state of the AsyncValue.T> , provided by the AsyncValueX extension
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override