country static method

FormFieldValidator<String> country({
  1. List<String> countryWhitelist = const <String>[],
  2. List<String> countryBlacklist = const <String>[],
  3. String? errorText,
  4. bool checkNullOrEmpty = true,
})

FormFieldValidator that requires the field's value to be a valid country.

Parameters:

  • countryWhitelist The list of allowed countries.
  • countryBlacklist The list of disallowed countries.
  • errorText The error message when the country is invalid.
  • checkNullOrEmpty Whether to check for null or empty values.

Implementation

static FormFieldValidator<String> country({
  List<String> countryWhitelist = const <String>[],
  List<String> countryBlacklist = const <String>[],
  String? errorText,
  bool checkNullOrEmpty = true,
}) => CountryValidator(
  countryWhitelist: countryWhitelist,
  countryBlacklist: countryBlacklist,
  errorText: errorText,
  checkNullOrEmpty: checkNullOrEmpty,
).validate;