unwrapOr method

T unwrapOr(
  1. T defaultValue
)

Returns the contained Some value or a provided default.

Implementation

@pragma("vm:prefer-inline")
T unwrapOr(T defaultValue) {
  if (v == null) {
    return defaultValue;
  } else {
    return v!;
  }
}