valueOrNull property

  1. @useResult
T? valueOrNull

The contained value if this is a Some, or null otherwise.

Examples

// prints "2"
print(const Some(2).valueOrNull);

// prints "null"
print(const None<int>().valueOrNull);

Implementation

@useResult
T? get valueOrNull;