constructor Null safety

  1. {Comparable? lessThan,
  2. Comparable? greaterThan,
  3. Comparable? equalTo,
  4. Comparable? greaterThanEqualTo,
  5. Comparable? lessThanEqualTo,
  6. bool onUpdate = true,
  7. bool onInsert = true}

A validator for comparing a value.

Values passing through validators of this type must be lessThan, greaterThan, lessThanEqualTo, equalTo, or [greaterThanEqualTo to the value provided for each argument.

Any argument not specified is not evaluated. A typical validator only uses one argument: 10.0)
    double value;

All provided arguments are evaluated. Therefore, the following requires an input value to be between 6 and 10: 6, lessThanEqualTo: 10)
    int value;

This validator can be used for String, double, int and DateTime properties.

When creating a validator for DateTime properties, the value for an argument is a String that will be parsed by DateTime.parse. "2017-02-11T00:30:00Z")
  DateTime date;

If onUpdate is true (the default), this validation is run on update queries. If onInsert is true (the default), this validation is run on insert queries.


    {Comparable? lessThan,
    Comparable? greaterThan,
    Comparable? equalTo,
    Comparable? greaterThanEqualTo,
    Comparable? lessThanEqualTo,
    bool onUpdate = true,
    bool onInsert = true})
    : this._(
          lessThan: lessThan,
          lessThanEqualTo: lessThanEqualTo,
          greaterThan: greaterThan,
          greaterThanEqualTo: greaterThanEqualTo,
          equalTo: equalTo,
          onUpdate: onUpdate,
          onInsert: onInsert,
          validator: ValidateType.comparison);