or method

T or (T defaultValue)

Gets the Optional value with a default.

The default is returned if the Optional is absent().

Throws ArgumentError if defaultValue is null.

Implementation

T or(T defaultValue) {
  if (defaultValue == null) {
    throw new ArgumentError('defaultValue must not be null.');
  }
  return _value == null ? defaultValue : _value;
}