FutureOrExt<T> extension

Convenience methods for inspecting and converting a FutureOr.

on

Properties

isFuture bool

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

Returns true if this is a Future.
no setter
isNotFuture bool

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

Returns true if this is not a Future.
no setter

Methods

asFutureOrNull() Future<T>?

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

Returns this as a Future, or null if it's a synchronous value.
asNonFutureOrNull() → T?

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

Returns the synchronous value, or null if this is a Future.
toFuture() Future<T>

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

Returns a Future, wrapping the value if it's not already one.
withMinDuration(Duration? duration) FutureOr<T>

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

Ensures that resolving this value takes at least a specified duration.