From 715164f2c5ffa8698c44282be40c4853278e15f1 Mon Sep 17 00:00:00 2001 From: Sylwia Date: Sun, 8 Dec 2024 11:52:56 +0100 Subject: [PATCH 1/2] Fix: Apply sorting only to country list, not favorites --- lib/src/_country_selector_controller.dart | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/src/_country_selector_controller.dart b/lib/src/_country_selector_controller.dart index 45a0262..3ea79fc 100644 --- a/lib/src/_country_selector_controller.dart +++ b/lib/src/_country_selector_controller.dart @@ -20,7 +20,7 @@ class CountrySelectorController with ChangeNotifier { List countriesIsoCode, List favoriteCountriesIsoCode, ) { - _countries = _buildLocalizedCountryList(context, countriesIsoCode); + _countries = _buildLocalizedCountryList(context, countriesIsoCode)..sort((a, b) => a.name.compareTo(b.name)); _favoriteCountries = _buildLocalizedCountryList(context, favoriteCountriesIsoCode); _filteredCountries = _countries; @@ -60,7 +60,6 @@ class CountrySelectorController with ChangeNotifier { localization.countryName(isoCode), ), ) - .toList() - ..sort((a, b) => a.name.compareTo(b.name)); + .toList(); } } From ba51c1850f83d966e9e28cda1349823c0db11e89 Mon Sep 17 00:00:00 2001 From: Sylwia Date: Mon, 9 Dec 2024 09:24:49 +0100 Subject: [PATCH 2/2] chore: bump version to 1.0.14 and update changelog --- CHANGELOG.md | 4 ++++ pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05d6a97..167408c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/pubspec.yaml b/pubspec.yaml index c505071..edf3e07 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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