@@ -43,7 +43,8 @@ class _MyAppState extends State<MyApp> {
|
|||||||
showFlagDialog: true,
|
showFlagDialog: true,
|
||||||
comparator: (a, b) => b.name.compareTo(a.name),
|
comparator: (a, b) => b.name.compareTo(a.name),
|
||||||
//Get the country information relevant to the initial selection
|
//Get the country information relevant to the initial selection
|
||||||
onInit: (code) => print("${code.name} ${code.dialCode}"),
|
onInit: (code) =>
|
||||||
|
print("on init ${code.name} ${code.dialCode}"),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 400,
|
width: 400,
|
||||||
|
|||||||
@@ -163,11 +163,15 @@ class CountryCodePickerState extends State<CountryCodePicker> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void didUpdateWidget(CountryCodePicker oldWidget) {
|
void didChangeDependencies() {
|
||||||
super.didUpdateWidget(oldWidget);
|
super.didChangeDependencies();
|
||||||
|
|
||||||
this.elements = elements.map((e) => e.localize(context)).toList();
|
this.elements = elements.map((e) => e.localize(context)).toList();
|
||||||
_onInit(selectedItem);
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void didUpdateWidget(CountryCodePicker oldWidget) {
|
||||||
|
super.didUpdateWidget(oldWidget);
|
||||||
|
|
||||||
if (oldWidget.initialSelection != widget.initialSelection) {
|
if (oldWidget.initialSelection != widget.initialSelection) {
|
||||||
if (widget.initialSelection != null) {
|
if (widget.initialSelection != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user