Either<S extends Object?, E extends Exception> class
sealed
This abstract class defines the success and failure states. in a Either<Success, Failure> manner. Use in cases where it is necessary to handle errors more explicitly. This is done by implemeting the when method as a pattern matching method. Where the success callback is called if the result is a success, and the failure callback is called if the result is a failure.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
ReturnType> (SuccessCallback< S, E, ReturnType> onSuccess, FailureCallback<S, E, ReturnType> onFailure) → ReturnType -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited