AsyncError<T> class
The error state of an AsyncValue, holding the error and stackTrace.
- Inheritance
-
- Object
- AsyncValue<
T> - AsyncError
Constructors
- AsyncError(Object error, StackTrace stackTrace)
-
Creates an AsyncError with the given
errorandstackTrace.const
Properties
- error → Object
-
The error object from the failed operation.
final
- hasData → bool
-
Whether this value holds successful data.
no setterinherited
- hasError → bool
-
Whether this value represents a failed operation.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setteroverride
- hasValue → bool
-
Alias for whether valueOrNull is non-null.
no setterinherited
- isLoading → bool
-
Whether this value is currently loading.
no setterinherited
- requireValue → T
-
Returns the current value, throwing a StateError if no data is
available.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stackTrace → StackTrace
-
The stack trace captured at the point of failure.
final
- valueOrNull → T?
-
The most recent successful value, or
nullif no data has arrived yet.no setterinherited
Methods
-
maybeWhen<
R> ({R data(T data)?, R loading(T? previousData)?, R error(Object error, StackTrace stackTrace)?, required R orElse()}) → R -
Pattern-matches with an
orElsefallback for unhandled states.inherited -
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(T? previousData), required R error(Object error, StackTrace stackTrace)}) → R -
Exhaustively pattern-matches all three async states.
inherited
-
whenOrNull<
R> ({R data(T data)?, R loading(T? previousData)?, R error(Object error, StackTrace stackTrace)?}) → R? -
Pattern-matches and returns
nullfor unhandled states.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override