EqualToValidator constructor
const
EqualToValidator(})
A validator that checks if a value is equal to another value. This validator is used to validate strings and other types that have a length property. It returns an error message if the value is not equal to another value. Example usage:
final validator = EqualToValidator('Hello', errorMessage: 'Value must be equal to Hello');
String? result = validator.validate("test");
print(result); // 'Value must be equal to Hello'
Implementation
const EqualToValidator(
this.equalTo, {
this.caseSensitive = true,
this.useTrim = false,
String? errorMessage,
}) : super(errorMessage);