If<T> constructor

const If<T>(
  1. OvO condition, {
  2. required OvO<T> then,
  3. OvO<T>? orElse,
  4. String? message,
})

Creates a If-case OvO schema.

  • condition is the condition for the if case.
  • then is the value to be returned if the condition validate passes.
  • orElse is the value to be returned if the condition is false.

If orElse is not provided, an OvOException is thrown when the condition is false.

Implementation

const If(this.condition, {required this.then, this.orElse, this.message});