map<R> method

Result<R> map<R>(
  1. R f(
    1. T
    )
)

Implementation

Result<R> map<R>(R Function(T) f) {
  if (isSuccess) {
    return Result.success(f(value!));
  } else {
    return Result<R>(
      isSuccess: false,
      errorKey: errorKey,
      errorMessage: errorMessage,
    );
  }
}