whenAsync<R> method

Future<R> whenAsync<R>({
  1. required FutureOr<R> some(
    1. T
    ),
  2. required FutureOr<R> none(),
})

Asynchronously invokes either some or none depending on the option.

Identical to match except that the arguments are named.

Implementation

Future<R> whenAsync<R>({
  required FutureOr<R> Function(T) some,
  required FutureOr<R> Function() none,
}) =>
    matchAsync(some, none);