OptionMapFilterAsyncX<T extends Object> extension
Collection of method for async map and filter in a Option
Methods
-
filterAsync(
FutureOr< bool> predicate(T)) → Future<Option< T> > -
Returns
None
if the option isNone
, otherwise callspredicate
with the wrapped value and returns: -
mapAsync<
U extends Object> (FutureOr< U> op(T)) → Future<Option< U> > -
Maps an
Option<T>
toOption<U>
by applying an asynchronous function to a containedSome
value. Otherwise returns aNone
. -
mapOrAsync<
U> (FutureOr< U> op(T), U opt) → Future<U> - Applies an asynchronous function to the contained value (if any), or returns the provided default (if not).
-
mapOrElseAsync<
U> (FutureOr< U> op(T), FutureOr<U> def()) → Future<U> -
Maps an
Option<T>
toU
by applying an asynchronous function to a containedT
value, or computes a default (if not).