ErrorOperation<T> class
final
Represents a failed operation with error details. Can optionally retain cached data from a previous successful operation.
- Inheritance
-
- Object
- OperationState<
T> - ErrorOperation
- Available extensions
Constructors
- ErrorOperation({String? message, Object? error, StackTrace? stackTrace, T? data})
-
Creates an error state with the specified error details.
const
Properties
-
copyWith
→ ErrorOperation<
T> Function({T? data, Object? error, String? message, StackTrace? stackTrace}) -
Copies this error state, preserving omitted fields.
Passing
nullexplicitly clears the corresponding field.no setteroverride - data → T?
-
The data associated with the operation, if any.
no setterinherited
- dataOrNull → T?
-
The data associated with the operation, as a nullable
T?.no setterinherited - error → Object?
-
The error object that caused the error.
final
- hasData → bool
-
Whether this state has associated data.
no setterinherited
- hashCode → int
-
Hash of the fields used by equality.
no setteroverride
- hasNoData → bool
-
Whether this state has no associated data.
no setterinherited
- isError → bool
-
A convenience getter to check if the operation has encountered an error.
no setterinherited
- isIdle → bool
-
A convenience getter to check if the operation is idle.
no setterinherited
- isLoading → bool
-
A convenience getter to check if the operation is currently loading
and not an idle state.
no setterinherited
- isNotError → bool
-
A convenience getter to check if the operation has not encountered an
error.
no setterinherited
- isNotIdle → bool
-
A convenience getter to check if the operation is not idle.
no setterinherited
- isNotLoading → bool
-
A convenience getter to check if the operation is currently not loading.
no setterinherited
- isNotSuccess → bool
-
A convenience getter to check if the operation has not successfully loaded
data.
no setterinherited
- isSuccess → bool
-
A convenience getter to check if the operation has successfully loaded
data.
no setterinherited
- message → String?
-
Human-readable error message for display to users.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stackTrace → StackTrace?
-
Stack trace from when the error occurred.
final
-
transitionTo
→ FromError<
T> -
Available on ErrorOperation<
Available destinations for this statically typed state.T> , provided by the ErrorTransitions extensionno setter -
transitionTo
→ AllTransitions<
T> -
Available on OperationState<
Available destinations for this statically typed state.T> , provided by the OperationTransitions extensionno setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
Diagnostic representation of this snapshot.
override
Operators
-
operator ==(
Object other) → bool -
Compares fields by equality, without deep collection comparison.
override