AsyncValue<T> class sealed

Constructors

AsyncValue.loading()
Constructs an AsyncLoading.
const
factory
AsyncValue.withData(T data)
Constructs an AsyncValue.
const
factory
AsyncValue.withError(Object error, StackTrace stackTrace)
Constructs an AsyncError.
const
factory

Properties

data → T?
The data of an AsyncValue. Is always T if the state is AsyncData.
no setter
error Object?
The error of an AsyncValue. Is not null if the state is AsyncError.
no setter
hasData bool
Whether the state is AsyncData.
no setter
hasError bool
Whether the state is AsyncError.
no setter
hashCode int
The hash code for this object.
no setteroverride
isLoading bool
Whether the state is AsyncLoading.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stackTrace StackTrace?
The stack trace of an AsyncValue. Is not null if the state is AsyncError.
no setter

Methods

maybeWhen<R>({R data(T data)?, R error(Object error, StackTrace stackTrace)?, R loading()?, required R orElse()}) → R
Syntactic sugar for AsyncSnapshot.
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
Syntactic sugar for AsyncValue.

Operators

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