diff --git a/lib/src/providers/country_provider.dart b/lib/src/providers/country_provider.dart index b181ce25fb..8249214485 100644 --- a/lib/src/providers/country_provider.dart +++ b/lib/src/providers/country_provider.dart @@ -19,9 +19,10 @@ class CountryProvider { if (countries == null || countries.isEmpty) { return jsonList.map((country) => Country.fromJson(country)).toList(); } - List filteredList = jsonList.where((country) { - return countries.contains(country[PropertyName]); - }).toList(); + List filteredList = countries + .map((countryCode) => jsonList.firstWhere((country) => country[PropertyName] == countryCode, + orElse: () => null)) + .toList(); return filteredList.map((country) => Country.fromJson(country)).toList(); }