Err<T, E> class
Represents a failed result containing an error
- Inheritance
-
- Object
- LocalDbResult<
T, E> - Err
Constructors
- Err(E error)
-
const
Properties
- error → E
-
The error that occurred
final
- errOrNull → E?
-
Returns the error if present, null otherwise
no setterinherited
- hashCode → int
-
The hash code for this object.
no setteroverride
- isErr → bool
-
Returns true if this is an error result
no setterinherited
- isOk → bool
-
Returns true if this is a successful result
no setterinherited
- okOrNull → T?
-
Returns the success value if present, null otherwise
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
map<
R> (R mapper(T value)) → LocalDbResult< R, E> -
Maps the success value to a new type
inherited
-
mapErr<
R> (R mapper(E error)) → LocalDbResult< T, R> -
Maps the error to a new type
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
-
unwrap(
) → T -
Returns the success value or throws the error
inherited
-
unwrapOr(
T defaultValue) → T -
Returns the success value or the provided default
inherited
-
when<
R> ({required R ok(T value), required R err(E error)}) → R -
Pattern matching method for handling both success and error cases
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override