toAsync method
Async<T>
toAsync({
- @noFutures TOnErrorCallback<
T> ? onError, - @noFutures TVoidCallback? onFinalize,
Implementation
@pragma('vm:prefer-inline')
Async<T> toAsync({
@noFutures TOnErrorCallback<T>? onError,
@noFutures TVoidCallback? onFinalize,
}) {
assert(
!isSubtype<T, Future<Object>>(),
'Do not call toAsync on nested futures: $T.',
);
return Async(() => this, onError: onError, onFinalize: onFinalize);
}