licensePlate static method
FormFieldValidator that requires the field's value to be a valid license plate.
Parameters:
-
regex
The regex pattern to match. -
licensePlateWhitelist
The list of allowed license plates. -
licensePlateBlacklist
The list of disallowed license plates. -
errorText
The error message when the license plate is invalid. -
checkNullOrEmpty
Whether to check for null or empty values. This regex matches a valid license plate format. -
It allows alphanumeric characters.
-
It supports common formats used in various regions.
Examples: ABC123, 123ABC, ABC-1234
Implementation
static FormFieldValidator<String> licensePlate({
RegExp? regex,
List<String> licensePlateWhitelist = const <String>[],
List<String> licensePlateBlacklist = const <String>[],
String? errorText,
bool checkNullOrEmpty = true,
}) => LicensePlateValidator(
regex: regex,
licensePlateWhitelist: licensePlateWhitelist,
licensePlateBlacklist: licensePlateBlacklist,
errorText: errorText,
checkNullOrEmpty: checkNullOrEmpty,
).validate;