valueOrNull property

  1. @useResult
T? valueOrNull

The contained value if this is an Ok, or null otherwise.

Examples

// prints "2"
print(const Ok<int, String>(2).valueOrNull);

// prints "null"
print(const Err<int, String>('error').valueOrNull);

Implementation

@useResult
T? get valueOrNull;