FutureOrExtension<T> extension
Extension for FutureOr.
- on
-
- FutureOr<
T>
- FutureOr<
Properties
-
asFuture
→ Future<
T> -
Available on FutureOr<
Returns a Future of this instance.T> , provided by the FutureOrExtension extensionno setter - genericType → Type
-
Available on FutureOr<
Returns the type ofT> , provided by the FutureOrExtension extensionT
.no setter - isResolved → bool
-
Available on FutureOr<
ReturnsT> , provided by the FutureOrExtension extensiontrue
if this instance is aT
value (not a Future).no setter
Methods
-
onResolve<
R> (void callback(T r)) → FutureOr< void> -
Available on FutureOr<
Resolves this instance and callsT> , provided by the FutureOrExtension extensioncallback
. Returnsvoid
. -
resolve(
{FutureOr< bool> validate(T val)?, T? defaultValue}) → FutureOr<T> -
Available on FutureOr<
Resolves this instance.T> , provided by the FutureOrExtension extension -
resolveBoth<
R> (FutureOr< T> other, FutureOr<R> resolver(T val1, T val2)) → FutureOr<R> -
Available on FutureOr<
ResolvesT> , provided by the FutureOrExtension extensionthis
andother
withresolver
. -
resolveMapped<
R> (FutureOr< R> mapper(T val)) → FutureOr<R> -
Available on FutureOr<
Resolves this instance mapping toT> , provided by the FutureOrExtension extensionmapper
and return its result. -
resolveOther<
R, E> (FutureOr< E> other, FutureOr<R> resolver(T val1, E val2)) → FutureOr<R> -
Available on FutureOr<
ResolvesT> , provided by the FutureOrExtension extensionthis
andother
withresolver
. -
resolveWith<
R> (FutureOr< R> resolver()) → FutureOr<R> -
Available on FutureOr<
Resolves this instance withT> , provided by the FutureOrExtension extensionresolver
result. -
resolveWithValue<
V> (V value) → FutureOr< V> -
Available on FutureOr<
Resolves this instance withT> , provided by the FutureOrExtension extensionvalue
. -
then<
R> (FutureOr< R> onValue(T value), {Function? onError}) → FutureOr<R> -
Available on FutureOr<
Same as Future.then.T> , provided by the FutureOrExtension extension -
validate(
FutureOr< bool> validate(T val)?, {T? defaultValue}) → FutureOr<T?> -
Available on FutureOr<
ValidateT> , provided by the FutureOrExtension extensionthis
instance withvalidate
. ReturnsdefaultValue
if not valid or value is null.