getOfficalNameByCode function

String getOfficalNameByCode(
  1. String code
)

Implementation

String getOfficalNameByCode(String code) {
  final matchingCountry = countryList().firstWhere(
    (country) => country.alpha2 == code,
  );

  return matchingCountry.officialName;
}