AsyncError<T> class
final
Error state for an AsyncValue.
- Inheritance
-
- Object
- AsyncValue<
T> - AsyncError
Constructors
- AsyncError(Object error, StackTrace stack, {T? previous})
-
Creates an error value with its stack trace and optional previous data.
const
Properties
-
asData
→ AsyncData<
T> ? -
Returns this value as AsyncData if it holds data, otherwise null.
no setterinherited
-
asError
→ AsyncError<
T> ? -
Returns this value as AsyncError if it holds an error, otherwise null.
no setterinherited
- error → Object
-
Returns the error if present, otherwise null.
final
- hasError → bool
-
Whether this value represents an error state.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isLoading → bool
-
Whether this value represents a loading state.
no setterinherited
- previous → T?
-
final
- requireValue → T
-
Returns the current data or throws if no data is available.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stack → StackTrace
-
final
- stackTrace → StackTrace?
-
Returns the stack trace if present, otherwise null.
no setterinherited
- value → T?
-
Returns the latest data value, including cached/previous values.
no setterinherited
- valueOrNull → T?
-
Returns the current data value if available, otherwise null.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
Returns a debug-friendly string for this state.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited