flutter-form-builder-ecosystem / flutter_form_builder

Simple form maker for Flutter Framework
https://pub.dev/packages/flutter_form_builder
MIT License
1.48k stars 535 forks source link

[General] FocusNode not passed to FormBuilderCheckbox, FormBuilderRadioGroup #1296

Open vickygidvir opened 1 year ago

vickygidvir commented 1 year ago

Is there an existing issue for this?

Package/Plugin version

9.1.0

Platforms

Flutter doctor

Flutter doctor ```bash ```

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 ```dart ```

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

khirsig commented 1 year ago

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.