flutter-form-builder-ecosystem / form_builder_phone_field

International phone number field for FlutterFormBuilder package
https://pub.dev/packages/form_builder_phone_field
BSD 3-Clause "New" or "Revised" License
11 stars 19 forks source link

FormBuilderPhoneField not show value after patchValue #26

Closed r-manopa closed 1 year ago

r-manopa commented 1 year ago
final formKey = GlobalKey<FormBuilderState>();

formKey.currentState?.patchValue({
      'phoneNo': '+66987654321',
 });
FormBuilder(
    key: formKey,
 ....
FormBuilderPhoneField(
       name: 'phoneNo',
    decoration: const InputDecoration(
      hintText: 'หมายเลขโทรศัพท์',
      errorStyle: TextStyle(color: Colors.red),
      contentPadding: EdgeInsets.all(0.0),
    ),
    priorityListByIsoCode: const ['TH'],
    defaultSelectedCountryIsoCode: 'TH',
    validator: FormBuilderValidators.compose([
      FormBuilderValidators.numeric(errorText: 'ใช้เฉพาะตัวเลขเท่านั้น')
    ]),
  ),

dependencies: flutter_form_builder: ^7.7.0 form_builder_phone_field: ^1.3.0 form_builder_validators: ^8.3.0

deandreamatias commented 1 year ago

Try didChange method

r-manopa commented 1 year ago

not working