Success<S, F> class final

Success case of Result

Wraps a successful value.

Inheritance
Available extensions

Constructors

Success(S value)
Create a success result with value
const

Properties

hashCode → int
The hash code for this object.
no setteroverride
isFailure → bool
Check if this is a failure
no setterinherited
isSuccess → bool
Check if this is a success
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value → S
The success value
final

Methods

flatMap<T>(Result<T, F> transform(S value)) → Result<T, F>
FlatMap for chaining Result-returning operations
override
flatMapAsync<T>(Future<Result<T, F>> transform(S value)) → Future<Result<T, F>>

Available on Result<S, F>, provided by the ResultAsyncExtensions extension

FlatMap with an async function
fold<T>(T onSuccess(S value), T onFailure(F error)) → T
Fold the result into a single value
override
foldAsync<T>(Future<T> onSuccess(S value), Future<T> onFailure(F error)) → Future<T>
Async version of fold
inherited
getFailureOrNull() → F?
Get the failure value or null
override
getOrElse(S defaultValue()) → S
Get the success value or return a default
override
getOrNull() → S?
Get the success value or null
override
getOrThrow() → S
Get the success value or throw the failure
override
map<T>(T transform(S value)) → Result<T, F>
Map the success value to a new type
override
mapAsync<T>(Future<T> transform(S value)) → Future<Result<T, F>>

Available on Result<S, F>, provided by the ResultAsyncExtensions extension

Map the success value with an async function
mapFailure<T>(T transform(F error)) → Result<S, T>
Map the failure value to a new type
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onFailure(void action(F error)) → Result<S, F>
Execute a side effect if this is a failure
override
onSuccess(void action(S value)) → Result<S, F>
Execute a side effect if this is a success
override
toFuture() → Future<S>
Convert to a Future that completes with success or throws on failure
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override