diff --git a/lib/src/country_codes.dart b/lib/src/country_codes.dart index f39da62..f4b3baf 100644 --- a/lib/src/country_codes.dart +++ b/lib/src/country_codes.dart @@ -85,9 +85,7 @@ class CountryCodes { /// Returns the `CountryDetails` for the given country alpha2 code. static CountryDetails detailsFromAlpha2(String alpha2) { - return CountryDetails.fromMap(codes.entries - .where((entry) => entry["alpha2Code"] == alpha2) - .single); + return CountryDetails.fromMap(codes.entries.where((entry) => entry.key == alpha2).single); }