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
U mapOrElse<U>(U Function() defaultFn, U Function(T) f) {
if (v == null) {
return defaultFn();
} else {
return f(v!);
}
}