StartWithValidator constructor
const
StartWithValidator(})
A validator that checks if a value starts 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 does not start with the specified string.
The startWith parameter specifies the desired string that the value should start with.
Example usage:
final validator = StartWithValidator('Hello','Value must start with Hello');
String? result = validator.validate("test");
print(result); // 'Value must start with Hello'
Implementation
const StartWithValidator(
this.startWith, {
this.caseSensitive = true,
this.useTrim = false,
String? errorMessage,
}) : super(errorMessage);