PropertiesComparisonRule class

Validation rule that compares two object properties.

See IValidationRule

Example

var schema =  ObjectSchema()
    .withRule(PropertyComparisonRule('field1', 'NE', 'field2'));

schema.validate({ field1: 1, field2: 2 });       // Result: no errors
schema.validate({ field1: 1, field2: 1 });       // Result: field1 shall not be equal to field2
schema.validate({});                             // Result: no errors
Implemented types

Constructors

PropertiesComparisonRule(String property1, String operation, String property2)
Creates a new validation rule and sets its arguments.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
validate(String? path, Schema schema, dynamic value, List<ValidationResult> results) → void
Validates a given value against this rule.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited