fix : publish the initial selection when the country picker is first initiated.
This commit is contained in:
@@ -93,6 +93,9 @@ class _CountryCodePickerState extends State<CountryCodePicker> {
|
|||||||
null)
|
null)
|
||||||
.toList();
|
.toList();
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
|
_publishSelection(selectedItem);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _showSelectionDialog() {
|
void _showSelectionDialog() {
|
||||||
@@ -105,10 +108,14 @@ class _CountryCodePickerState extends State<CountryCodePicker> {
|
|||||||
selectedItem = e;
|
selectedItem = e;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (widget.onChanged != null) {
|
_publishSelection(e);
|
||||||
widget.onChanged(e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _publishSelection(CElement e) {
|
||||||
|
if (widget.onChanged != null) {
|
||||||
|
widget.onChanged(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user