mapOr<U> method
U
mapOr<U>(
- U op(
- T
- U opt
inherited
Applies a function to the contained value (if any), or returns the provided default (if not).
Implementation
U mapOr<U>(U Function(T) op, U opt) {
final val = toNullable();
if (val != null) {
return op(val);
} else {
return opt;
}
}