Skip to content

Commit

Permalink
fix refCountryCode issue
Browse files Browse the repository at this point in the history
  • Loading branch information
wchklaus97 committed Nov 12, 2022
1 parent 4017064 commit 7ce8c43
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@
## 0.0.8

* Add refCountryCode and Update README.md

## 0.0.9

* Fix refCountryCode issues
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class App extends StatelessWidget {
// select the Chinese locale to label the text rather than English
selectedLocale: SelectedLocale.zhCH,
// set the default selected country
refCountryCode: "HK",
refCountryCode: "hk",
// callback of the selected country
onSelectedCountry: (country) async {
// dialog to show the info of the country object
Expand Down
3 changes: 2 additions & 1 deletion lib/country_selector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ class CountrySelectorWidgetState extends State<CountrySelectorWidget> {
}
if (widget.refCountryCode != null) {
List<Country> refCountry = _countries
.where((country) => country.code == widget.refCountryCode)
.where(
(country) => country.code == widget.refCountryCode!.toUpperCase())
.toList();
if (refCountry.length == 1) {
_selectedCountryNotifi.value = refCountry.first;
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: country_selector_widget
description: Country Selector Widget provides CountrySelectorWidget and showCountrySelectorBottomSheet to fulfill the needed usage.
version: 0.0.8
version: 0.0.9
homepage: https://hkk97.github.io/country_selector_widget/

environment:
Expand Down

0 comments on commit 7ce8c43

Please sign in to comment.