Validate constructor Null safety

const Validate(
  1. {bool onUpdate = true,
  2. bool onInsert = true}
)

Invoke this constructor when creating custom subclasses.

This constructor is used so that subclasses can pass onUpdate and onInsert. Example: class CustomValidate extends Validate

       bool validate(
         ValidateOperation operation,
         ManagedAttributeDescription property,
         String value,
         List<String> errors) {
           return someCondition;
       }
    }

Implementation

const Validate({bool onUpdate = true, bool onInsert = true})
    : runOnUpdate = onUpdate,
      runOnInsert = onInsert,
      _value = null,
      _lessThan = null,
      _lessThanEqualTo = null,
      _greaterThan = null,
      _greaterThanEqualTo = null,
      _equalTo = null,
      type = null;