Optional< T>.of constructor
Constructs an Optional of the given value
.
Throws ArgumentError if value
is null.
Implementation
Optional.of(T value) : this._value = value {
if (this._value == null) throw new ArgumentError('Must not be null.');
}