toAsync method

Async<T> toAsync({
  1. Err<T> onError(
    1. Object?
    )?,
  2. void onFinalize()?,
})

Implementation

@pragma('vm:prefer-inline')
Async<T> toAsync({
  Err<T> Function(Object?)? onError,
  void Function()? onFinalize,
}) {
  assert(
    !_isSubtype<T, Future<Object>>(),
    'Do not call toAsync on nested futures: $T.',
  );
  return Async(() => this, onError: onError, onFinalize: onFinalize);
}