mapOrElse<U> method
U
mapOrElse<U>(
- U defaultFn(),
- U f(
- T
Computes a default function result (if none), or applies a different function to the contained value (if any).
Implementation
@pragma("vm:prefer-inline")
U mapOrElse<U>(U Function() defaultFn, U Function(T) f) {
if (v == null) {
return defaultFn();
} else {
return f(v!);
}
}