Skip to content
This repository has been archived by the owner on Jul 20, 2022. It is now read-only.

Add updateCountryCode function #178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
20 changes: 10 additions & 10 deletions lib/country_code_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,7 @@ class CountryCodePickerState extends State<CountryCodePicker> {
),
).then((e) {
if (e != null) {
setState(() {
selectedItem = e;
});

_publishSelection(e);
updateCountryCode(e);
}
});
} else {
Expand Down Expand Up @@ -352,16 +348,20 @@ class CountryCodePickerState extends State<CountryCodePicker> {
),
).then((e) {
if (e != null) {
setState(() {
selectedItem = e;
});

_publishSelection(e);
updateCountryCode(e);
}
});
}
}

void updateCountryCode(CountryCode e) {
setState(() {
selectedItem = e;
});

_publishSelection(e);
}

void _publishSelection(CountryCode e) {
if (widget.onChanged != null) {
widget.onChanged!(e);
Expand Down