Closed lukehutch closed 12 months ago
Currently this package don't offer support for this. I don't sure about implement this feature in the feature, because is a widget that you can build manually, with one FormBuilderRadio or FormBuilderCheckbox for row or using FormBuilderRadioGroup FormBuilderCheckboxGroup
I am piling on to someone else's question here.
I spent a couple of hours looking at this and can't see how to insert any widgets between the FormBuilderCheckboxGroup
and a bunch of FormBuilderFieldOption
elements lay them into a table or grid.
FormBuilderCheckboxGroup
├── FormBuilderFieldOption
├── FormBuilderFieldOption
├── FormBuilderFieldOption
└── FormBuilderFieldOption
It sounds like you might be suggesting
FormBuilderCheckboxGroup
├── Some other container widget
│ └── FormBuilderCheckbox
├── Some other container widget
│ └── FormBuilderCheckbox
└── Some other container widget
└── FormBuilderCheckbox
There is some coordination between the FormBuilderChekcboxGroup
and the FormBuilderFieldOption
Is there any functionality lost if you create random FormBuilderCheckbox
down graph from the FormBuilderCheckboxGroup
?
If not then why does the FormBuilderFieldOption exist? To simplify layout?
Looking in the code....
It looks like the FormBuilderCheckboxGroup
actually builds
GroupedCheckbox
which builds a SingleChildScrollView
wrapping Wrap
, Column
, Row of Columns
based on orientation. that holdsEach option is
I don't see any of that in the widget inspector when actually running an app.
Assuming I understand the original question is actually two co-mingled FormBuilderCheckboxGroup
constructs which seems complicated. It would require some kind of tagging with FormBuilderCheckbox
looking up the tree to the nearest .
Providing a table layout for a single FormBuilderCheckboxGroup
might be as simple as another orientation with a number of columns.
With this comments, I think that the better option is create the own FormBuilderCheckboxGroup with table layout. From Flutter Form Builder Ecosystem, we can help to answer the questions about build but we won't create or modify the currently widget to offer support to this layout. Is something hard to maintain
You are suggesting to subclass (or wrap) FormBuilderCheckboxGroup
and override the build()
method to do the Grid/Table layout. It could use all the other utility methods do do the individual item/cell layout. Is that correct?
Another option is to convert OptionsOrientation
into an interface that includes a function that is used to render the group. The current switch statement in FormBuilderCheckboxGroup
for OptionsOrientation.horizontal
, etc would then just invoke a known method on the OptionsOrientation
interface. The current horizontal
, vertical
, etc would move from being enums to instances that implement the interface. This would let people plug in arbitrary orientations in the future and remove the funky hard coded layout currently in the FormBuilderCheckboxGroup
build()
method.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.
Environment
Package version: 7.7.0
Description
What you'd like to happen:
I need to build a form as a grid with three columns:
It would look like this
Alternatives you've considered:
I don't see any way to build this using the current API. It would be great to have some sort of grid form element that would allow a user to do this. Then they should be able to associate a radio group or checkbox group with a row or column.