city static method
FormFieldValidator that requires the field's value to be a valid city.
Parameters:
regex
The regex pattern to match.citiesWhitelist
The list of allowed cities.citiesBlacklist
The list of disallowed cities.errorText
The error message when the city is invalid.checkNullOrEmpty
Whether to check for null or empty values.
Implementation
static FormFieldValidator<String> city({
RegExp? regex,
List<String> citiesWhitelist = const <String>[],
List<String> citiesBlacklist = const <String>[],
String? errorText,
bool checkNullOrEmpty = true,
}) => CityValidator(
regex: regex,
citiesWhitelist: citiesWhitelist,
citiesBlacklist: citiesBlacklist,
errorText: errorText,
checkNullOrEmpty: checkNullOrEmpty,
).validate;