validateStateCountry static method

String? validateStateCountry(
  1. String? value
)

Does minimal validation of input. Only checks that input is more than 2 chars really. Maybe add in google autocomplete if necessary, but don't want to drive api cost if not required

Implementation

static String? validateStateCountry(String? value) {
  if (value == null) {
    return 'Value cannot be empty';
  }

  if (value.length <= 2) {
    return 'Value should be extended form. Eg. Missouri or Cuba';
  }

  return null;
}