Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.14

* Fix: Ensure sorting is applied only to the country list and not to favorite countries

## 1.0.13

* Add localizations for Urdu
Expand Down
5 changes: 2 additions & 3 deletions lib/src/_country_selector_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CountrySelectorController with ChangeNotifier {
List<IsoCode> countriesIsoCode,
List<IsoCode> favoriteCountriesIsoCode,
) {
_countries = _buildLocalizedCountryList(context, countriesIsoCode);
_countries = _buildLocalizedCountryList(context, countriesIsoCode)..sort((a, b) => a.name.compareTo(b.name));
_favoriteCountries =
_buildLocalizedCountryList(context, favoriteCountriesIsoCode);
_filteredCountries = _countries;
Expand Down Expand Up @@ -60,7 +60,6 @@ class CountrySelectorController with ChangeNotifier {
localization.countryName(isoCode),
),
)
.toList()
..sort((a, b) => a.name.compareTo(b.name));
.toList();
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_country_selector
description: how a country picker to select a country
version: 1.0.13
version: 1.0.14
repository: https://github.com/cedvdb/flutter_country_selector
homepage: https://github.com/cedvdb/flutter_country_selector

Expand Down
Loading