FutureOrX<T extends Object> extension

on

Properties

asAsync Future<T>

Available on FutureOr<T>, provided by the FutureOrX extension

Casts a value to a Future wrap the value in a Future if it is synchronous.
no setter
asSync → T

Available on FutureOr<T>, provided by the FutureOrX extension

Casts a value to a synchronous value or throws a TypeError if the value is a Future.
no setter
asSyncOrNull → T?

Available on FutureOr<T>, provided by the FutureOrX extension

Casts a value to a synchronous value or returns null if the value is a Future.
no setter

Methods

thenOr<R extends Object?>(TSyncOrAsyncMapper<T, R> callback, {void onError(Object e)?}) FutureOr<R>

Available on FutureOr<T>, provided by the FutureOrX extension

Maps a synchronous or asynchronous value to another.