ResultExtension<V> extension

on
  • Result<V>

Properties

error Object
no setter
hasValue bool
no setter
isSuccess bool
no setter
value → V
no setter

Methods

any(bool predicate(V)) bool
Returns false if isError or returns the result of the application of
bimap<U>(U transformValue(V), dynamic transformError(dynamic)) → Result<U>
Map over Error and Value of this Result
fanout<U>(Result<U> other()) → Result<Pair<V, U>>
flatMap<U>(Result<U> transform(V)) → Result<U>
flatMapError(Result<V> transform(dynamic)) → Result<V>
fold<X extends Object?>(X success(V value), X failure(dynamic error)) → X
Applies success if this is a isValue or error if this is a isError.
map<U>(U transform(V)) → Result<U>
The given function is applied if this is a Value.
mapBoth<U>(U transformValue(V), dynamic transformError(dynamic)) → Result<U>
mapError(dynamic transform(dynamic)) → Result<V>
The given function is applied if this is a Error.
maybeWhen<TResult extends Object?>({TResult success(V value)?, TResult error(dynamic e)?, required TResult orElse()}) → TResult
onError(dynamic f(dynamic)) → Result<V>
onFailure(dynamic f(dynamic)) → Result<V>
onSuccess(dynamic f(V)) → Result<V>
onValue(dynamic f(V)) → Result<V>
when<TResult extends Object?>({required TResult success(V value), required TResult error(dynamic error)}) → TResult