Skip to content

Commit 261b9f3

Browse files
author
Miguel Ruivo
authored
Update country_codes.dart
1 parent c39d442 commit 261b9f3

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/src/country_codes.dart

+1-3
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ class CountryCodes {
8585

8686
/// Returns the `CountryDetails` for the given country alpha2 code.
8787
static CountryDetails detailsFromAlpha2(String alpha2) {
88-
return CountryDetails.fromMap(codes.entries
89-
.where((entry) => entry["alpha2Code"] == alpha2)
90-
.single);
88+
return CountryDetails.fromMap(codes.entries.where((entry) => entry.key == alpha2).single);
9189
}
9290

9391

0 commit comments

Comments
 (0)