Result<ValueT, FailureT extends Exception> class
abstract
An operation's result. Can be a success or a failure.
- Implementers
- Annotations
Constructors
- Result.failure(FailureT failure)
-
constfactory
- Result.success(ValueT value)
-
constfactory
Properties
- failureOrNull → FailureT?
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isFailure → bool
-
no setter
- isValue → bool
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- valueOrNull → ValueT?
-
no setter
- valueOrThrow → ValueT
-
Returns the value if it is a success.
Else, throws the error as an Exception.
no setter
Methods
-
map<
T> ({required T success(ResultSuccess< ValueT, FailureT> result), required T failure(ResultFailure<ValueT, FailureT> result)}) → T -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
T> ({required T success(ValueT value), required T failure(FailureT failure)}) → T
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited