NotEndWithValidator constructor
const
NotEndWithValidator(})
A validator that checks if a value does not end with a specified string.
This validator is used to validate strings and other types that have a length property.
It returns an error message if the value ends with the specified string.
The notEndWith parameter specifies the desired string that the value should not end with.
Example usage:
final validator = NotEndWithValidator('Hello',errorMessage :'Value must not end with Hello');
String? result = validator.validate("Hello");
print(result); // Value must not end with Hello
Implementation
const NotEndWithValidator(
this.notEndWith, {
this.caseSensitive = true,
this.useTrim = true,
String? errorMessage,
}) : super(errorMessage);