toAsync method
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);
}