unwrap method

T unwrap()

Returns the contained Some value, consuming the this value.

Because this function may throw an error, its use is generally discouraged. Instead, prefer to handle the None case explicitly, or call unwrapOr or unwrapOrElse.

Implementation

T unwrap() => isSome
    ? _someValue
    : throw UnwrapError('called `Option#unwrap` on an `None` value');