AsyncValue<T> class sealed


AsyncValue

Represents the state of an asynchronous computation.

Implementers

Properties

asData AsyncData<T>?
Returns this value as AsyncData if it holds data, otherwise null.
no setter
asError AsyncError<T>?
Returns this value as AsyncError if it holds an error, otherwise null.
no setter
error Object?
Returns the error if present, otherwise null.
no setter
hasError bool
Whether this value represents an error state.
no setter
hashCode int
The hash code for this object.
no setterinherited
isLoading bool
Whether this value represents a loading state.
no setter
requireValue → T
Returns the current data or throws if no data is available.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stackTrace StackTrace?
Returns the stack trace if present, otherwise null.
no setter
value → T?
Returns the latest data value, including cached/previous values.
no setter
valueOrNull → T?
Returns the current data value if available, otherwise null.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

data<T>(T value) AsyncValue<T>
Creates an AsyncValue that contains data.