Result<S, E> class abstract

Base Result class

Receives two values E and S as E is an error and S is a success.

Implementers
Annotations
  • @sealed

Constructors

Result()
Default constructor.
const

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

get() → dynamic
Returns the current result.
isError() bool
Returns true if the current result is an Error.
isSuccess() bool
Returns true if the current result is a success.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onError<R>(R whenError(E error)) → R?
Execute whenError if the Result is an error.
onSuccess<R>(R whenSuccess(S success)) → R?
Execute whenSuccess if the Result is a success.
toString() String
A string representation of this object.
inherited
tryGetError() → E?
Returns the value of E if any.
tryGetSuccess() → S?
Returns the value of S if any.
when<W>(W whenSuccess(S success), W whenError(E error)) → W
Return the result in one of these functions.

Operators

operator ==(Object other) bool
The equality operator.
inherited