getCountryInfo method

Map<String, String>? getCountryInfo(
  1. String countryCode
)

Gets the country information for the supplied country code.

The countryCode param is the ISO-3166 country code. Returns a Map<String, String> if found.

Implementation

Map<String, String>? getCountryInfo(String countryCode) {
  if (_records.isEmpty) {
    throw Exception('No record available.');
  }
  return _records[countryCode];
}