city static method
FormFieldValidator that requires the field's value to be a valid city.
Parameters:
regexThe regex pattern to match.citiesWhitelistThe list of allowed cities.citiesBlacklistThe list of disallowed cities.errorTextThe error message when the city is invalid.checkNullOrEmptyWhether 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;