NotStartWithValidator constructor

const NotStartWithValidator(
  1. String notStartWith, {
  2. bool caseSensitive = true,
  3. bool useTrim = false,
  4. String? errorMessage,
})

A validator that checks if a value does not start 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 starts with the specified string. The notStartWith parameter specifies the undesired string that the value should not start with. Example usage:

final validator = NotStartWithValidator('Hello',errorMessage :'Value must not start with Hello');
String? result = validator.validate("Hello");
print(result); // Value must not start with Hello

Implementation

const NotStartWithValidator(
  this.notStartWith, {
  this.caseSensitive = true,
  this.useTrim = false,
  String? errorMessage,
}) : super(errorMessage);