flatMap<R> abstract method

Result<R> flatMap<R>(
  1. R onSuccess(
    1. T value
    ), {
  2. ExceptionHandler? exceptionHandler,
  3. String? errorGroup,
})

Maps a Result<T> to Result<R> using the provided function. If the original result is a failure, the same error is retained.

onSuccess is the function that transforms the value if the result is a success. exceptionHandler is an optional handler for any exceptions thrown during the transformation. errorGroup is an optional group identifier for the error.

Implementation

Result<R> flatMap<R>(
  R Function(T value) onSuccess, {
  ExceptionHandler? exceptionHandler,
  String? errorGroup,
});