flutter_form_builder icon indicating copy to clipboard operation
flutter_form_builder copied to clipboard

[General] FocusNode not passed to FormBuilderCheckbox, FormBuilderRadioGroup

Open vickygidvir opened this issue 2 years ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Package/Plugin version

9.1.0

Platforms

  • [X] Android
  • [X] iOS
  • [ ] Linux
  • [ ] MacOS
  • [X] Web
  • [ ] Windows

Flutter doctor

Flutter doctor

Minimal code example

// The focusNode parameter is present in the constructor

FormBuilderCheckbox({ // ... required this.title, this.focusNode, // ... : super( builder: (FormFieldState<bool?> field) { final state = field as _FormBuilderCheckboxState; return InputDecorator( decoration: state.decoration, child: CheckboxListTile( .... //observe focusNode is not passed here ), ); })

Code sample

Current Behavior

I found a bug in the FormBuilderCheckbox, FormBuilderRadioGroup classes where the focusNode is not being passed correctly. When using this widget, it should accept a focusNode parameter and pass it to the underlying CheckboxListTile. However, the focusNode parameter not being passed to CheckboxListTile, GroupedRadio. Hence the respective widgets are not getting focused.

Expected Behavior

The FormBuilderCheckbox , FormBuilderRadioGroup widgets should accept and correctly pass a focusNode parameter to the CheckboxListTile, this will lead to proper working of the focus in above mentioned widgets.

Steps To Reproduce

Steps to Reproduce:

1.Create a FormBuilderCheckbox or FormBuilderRadioGroup widget. 2.Set a focusNode for the widget. 3.Observe that the focusNode is not being applied to the Checkbox or RadioButton

Aditional information

No response

vickygidvir avatar Sep 20 '23 12:09 vickygidvir

We are trying to solve similar problems. Please join our discussion at https://github.com/flutter-form-builder-ecosystem/flutter_form_builder/discussions/1297 regarding this topic.

khirsig avatar Sep 20 '23 13:09 khirsig