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