UiFailure<T> class
final
The failure state containing error diagnostics and an optional error object.
Constructors
- UiFailure(String message, {Object? error, StackTrace? stackTrace})
-
const
Properties
- dataOrNull → T?
-
Returns data if the state is UiSuccess, otherwise null.
no setterinherited
- error → Object?
-
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- isFailure → bool
-
Whether the current state is UiFailure.
no setterinherited
- isIdle → bool
-
Whether the current state is UiIdle.
no setterinherited
- isLoading → bool
-
Whether the current state is UiLoading.
no setterinherited
- isSuccess → bool
-
Whether the current state is UiSuccess.
no setterinherited
- message → String
-
final
- messageOrNull → String?
-
Returns error message if the state is UiFailure, otherwise null.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stackTrace → StackTrace?
-
final
Methods
-
maybeWhen<
R> ({R idle()?, R loading()?, R success(T data)?, R failure(String message, Object? error, StackTrace? stackTrace)?, required R orElse()}) → R -
Partial pattern-matching with fallback.
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 idle(), required R loading(), required R success(T data), required R failure(String message, Object? error, StackTrace? stackTrace)}) → R -
Exhaustive pattern-matching across all 4 discrete states.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override