NotEqualLengthValidator constructor

const NotEqualLengthValidator(
  1. int length, [
  2. String? errorMessage
])

A validator that checks if a value does not have a specified length. This validator is used to validate strings and other types that have a length property. It returns an error message if the value has the specified length. The length parameter specifies the desired length that the value should not have. Example usage:

final validator = NotEqualLengthValidator(5,'Value must not have a length of 5');
String? result = validator.validate("Hello");
print(result); // Value must not have a length of 5

Implementation

const NotEqualLengthValidator(this.length, [super.errorMessage]);