File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,7 @@ class FormBuilderPhoneFieldState extends State<FormBuilderPhoneField> {
141
141
142
142
@override
143
143
void initState () {
144
+ super .initState ();
144
145
_formState = FormBuilder .of (context);
145
146
_formState? .registerFieldKey (widget.attribute, _fieldKey);
146
147
_initialValue = widget.initialValue ??
@@ -151,7 +152,6 @@ class FormBuilderPhoneFieldState extends State<FormBuilderPhoneField> {
151
152
_selectedDialogCountry = CountryPickerUtils .getCountryByIsoCode (
152
153
widget.defaultSelectedCountryIsoCode);
153
154
_parsePhone ();
154
- super .initState ();
155
155
}
156
156
157
157
Future <void > _parsePhone () async {
@@ -167,8 +167,10 @@ class FormBuilderPhoneFieldState extends State<FormBuilderPhoneField> {
167
167
_effectiveController.text = parseResult['national_number' ];
168
168
}
169
169
} catch (error) {
170
+ print (error);
170
171
_effectiveController.text = _initialValue.replaceFirst ('+' , '' );
171
172
}
173
+ setState (() {});
172
174
}
173
175
}
174
176
@@ -183,7 +185,7 @@ class FormBuilderPhoneFieldState extends State<FormBuilderPhoneField> {
183
185
184
186
return FormField (
185
187
key: _fieldKey,
186
- initialValue: fullNumber ,
188
+ initialValue: _initialValue ,
187
189
autovalidate: widget.autovalidate,
188
190
validator: (val) =>
189
191
FormBuilderValidators .validateValidators (val, widget.validators),
You can’t perform that action at this time.
0 commit comments