mapOrElse<U> method

Future<U> mapOrElse<U>(
  1. U defaultFn(),
  2. U f(
    1. T
    )
)

Implementation

@pragma("vm:prefer-inline")
Future<U> mapOrElse<U>(U Function() defaultFn, U Function(T) f) {
  return then((option) => option.isSome() ? f(option as T) : defaultFn());
}