normalizeCountryCode static method

String normalizeCountryCode(
  1. String countryCode
)

Normalizes country codes for search

Implementation

static String normalizeCountryCode(String countryCode) {
  if (countryCode.isEmpty) return countryCode;

  return countryCode
      .toUpperCase()
      .replaceAll(RegExp(r'[^A-Z]'), '') // Keep only letters
      .trim();
}