mapOr<U> method
Returns the contained value, if any, with map
applied to it, or defaultValue
otherwise.
Examples
// prints "4"
print(const Ok<int, String>(2).mapOr((value) => value * 2, 0));
// prints "0"
print(const Err<int, String>('error').mapOr((value) => value * 2, 0));
Implementation
@override
@useResult
U mapOr<U>(U Function(T value) map, U defaultValue) => map(value);