FtrResultExt<S, E> extension

Extension methods for FtrResult to provide convenient asynchronous operations. This extension allows chaining operations on Future

on

Properties

isError Future<bool>

Available on FtrResult<S, E>, provided by the FtrResultExt extension

Asynchronously checks if this result represents an error.
no setter
isSuccess Future<bool>

Available on FtrResult<S, E>, provided by the FtrResultExt extension

Asynchronously checks if this result represents a success.
no setter

Methods

execute() Future<void>

Available on FtrResult<S, E>, provided by the FtrResultExt extension

Asynchronously forces evaluation of the result without returning any value.
flat() Future<(S?, E?)>

Available on FtrResult<S, E>, provided by the FtrResultExt extension

Asynchronously flattens the result into a tuple.
getOrNull() Future<S?>

Available on FtrResult<S, E>, provided by the FtrResultExt extension

Asynchronously extracts the success value or returns null if the result is an error.
getOrThrow() Future<S>

Available on FtrResult<S, E>, provided by the FtrResultExt extension

Asynchronously extracts the success value or throws an exception if the result is an error.
mapError<E2>(E2 mapper(E err)) FtrResult<S, E2>

Available on FtrResult<S, E>, provided by the FtrResultExt extension

Asynchronously transforms the error value using a simple mapper function.
mapOnError<E2>(FutureOr<Result<S, E2>> mapper(E err)) FtrResult<S, E2>

Available on FtrResult<S, E>, provided by the FtrResultExt extension

Asynchronously transforms the error value using a mapper that returns a Result.
mapOnSuccess<S2>(FutureOr<Result<S2, E>> mapper(S data)) FtrResult<S2, E>

Available on FtrResult<S, E>, provided by the FtrResultExt extension

Asynchronously transforms the success value using a mapper that returns a Result.
mapSuccess<S2>(S2 mapper(S data)) FtrResult<S2, E>

Available on FtrResult<S, E>, provided by the FtrResultExt extension

Asynchronously transforms the success value using a simple mapper function.
nullable() FtrResult<S?, E>

Available on FtrResult<S, E>, provided by the FtrResultExt extension

Asynchronously converts the result to allow nullable success values.
onError(void onError(E error)) FtrResult<S, E>

Available on FtrResult<S, E>, provided by the FtrResultExt extension

Asynchronously executes a side effect if the result is an error.
onSuccess(void onSuccess(S data)) FtrResult<S, E>

Available on FtrResult<S, E>, provided by the FtrResultExt extension

Asynchronously executes a side effect if the result is successful.
resolve({required S onError(E error)}) Future<Success<S, E>>

Available on FtrResult<S, E>, provided by the FtrResultExt extension

Asynchronously converts any error result into a successful result.
when<T>({required T success(S data), required T error(E error)}) Future<T>

Available on FtrResult<S, E>, provided by the FtrResultExt extension

Asynchronously pattern matches on the result and executes the appropriate callback.