nullable method

OvO<T?> nullable()

Returns an instance of OvO that wraps the current value with nullable type.

The current value is of type T and the returned instance is of type OvO<T?>.

Example:

final schema = OvO<int>().nullable();

await schema.parse(null); // null
await schema.parse(1); // 1
await schema.parse('1'); // throws OvOException

Implementation

OvO<T?> nullable() => _Nullable(this);