EasyValidator.equalTo constructor

const EasyValidator.equalTo(
  1. String equalTo, {
  2. bool caseSensitive,
  3. bool useTrim,
  4. String? errorMessage,
})

A factory constructor for creating an EqualToValidator. The equalTo parameter specifies the string that the value being validated should be equal to. The errorMessage parameter is an optional error message to be displayed if the validation fails. Example usage:

final validator = EasyValidator.equalTo('Hello', errorMessage: 'Value must be equal to Hello');
String? result = validator.validate("test");
print(result); // 'Value must be equal to Hello'

Implementation

const factory EasyValidator.equalTo(
  String equalTo, {
  bool caseSensitive,
  bool useTrim,
  String? errorMessage,
}) = EqualToValidator;