to<R> method

Future<Tuple<T, R>?> to<R>(
  1. FutureOr<R> mapper(
    1. T? input
    )
)

Implementation

Future<Tuple<T, R>?> to<R>(FutureOr<R> mapper(T? input)) async {
  final T? resolved = await this;
  if (resolved == null) {
    return Future.value(null);
  }
  final b = await mapper(resolved);
  if (b != null) {
    return Tuple(resolved, b);
  } else {
    return Future.value(null);
  }
}