Refs #26: do not call onChanged during initState
This commit is contained in:
@@ -47,7 +47,7 @@ class CountryCodePicker extends StatefulWidget {
|
|||||||
List<Map> jsonList = codes;
|
List<Map> jsonList = codes;
|
||||||
|
|
||||||
List<CountryCode> elements = jsonList
|
List<CountryCode> elements = jsonList
|
||||||
.map((s) => new CountryCode(
|
.map((s) => CountryCode(
|
||||||
name: s['name'],
|
name: s['name'],
|
||||||
code: s['code'],
|
code: s['code'],
|
||||||
dialCode: s['dial_code'],
|
dialCode: s['dial_code'],
|
||||||
@@ -67,7 +67,7 @@ class _CountryCodePickerState extends State<CountryCodePicker> {
|
|||||||
_CountryCodePickerState(this.elements);
|
_CountryCodePickerState(this.elements);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => new FlatButton(
|
Widget build(BuildContext context) => FlatButton(
|
||||||
child: Flex(
|
child: Flex(
|
||||||
direction: Axis.horizontal,
|
direction: Axis.horizontal,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
@@ -121,10 +121,6 @@ class _CountryCodePickerState extends State<CountryCodePicker> {
|
|||||||
null)
|
null)
|
||||||
.toList();
|
.toList();
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
if (mounted) {
|
|
||||||
_publishSelection(selectedItem);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _showSelectionDialog() {
|
void _showSelectionDialog() {
|
||||||
|
|||||||
Reference in New Issue
Block a user