equalTo method

Validator equalTo(
  1. num target, {
  2. String? errorMessage,
})

Adds an EqualToRule to the validator.

The target parameter specifies the value that the input should be equal to. The errorMessage parameter is optional and can be used to provide a custom error message.

Implementation

Validator equalTo(num target, {String? errorMessage}) {
  addRule(EqualToRule(target, errorMessage: errorMessage));
  return this;
}