unwrap method
Returns the contained value.
Throws
Throws a StateError (with custom message msg
if provided) if this
is a None.
Examples
// prints "2"
print(const Some(2).unwrap());
// throws a `StateError`
print(const None<int>().unwrap());
Implementation
@override
@useResult
Never unwrap({String? msg}) => throw StateError(msg ?? 'tried to unwrap `None` as `Some`');