Skip to content

Commit

Permalink
Update country_codes.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Ruivo authored May 14, 2024
1 parent c39d442 commit 261b9f3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/src/country_codes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down

0 comments on commit 261b9f3

Please sign in to comment.