File tree Expand file tree Collapse file tree 4 files changed +24
-4
lines changed Expand file tree Collapse file tree 4 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,9 @@ class FormBuilderCheckboxGroup<T> extends FormBuilderFieldDecoration<List<T>> {
25
25
final ControlAffinity controlAffinity;
26
26
final OptionsOrientation orientation;
27
27
28
- /// A decorator that is applied to each select item - ex: box the item
28
+ /// A BoxDecoration that is added to each item if provided
29
+ /// WrapSpacing is reused for the the padding inside the itemDecoration
30
+ /// on the side opposite from the control
29
31
final BoxDecoration ? itemDecoration;
30
32
31
33
/// Creates a list of Checkboxes for selecting multiple options
Original file line number Diff line number Diff line change @@ -22,7 +22,9 @@ class FormBuilderRadioGroup<T> extends FormBuilderFieldDecoration<T> {
22
22
final WrapAlignment wrapRunAlignment;
23
23
final WrapCrossAlignment wrapCrossAxisAlignment;
24
24
25
- /// A decorator that is applied to each select item - ex: box the item
25
+ /// A BoxDecoration that is added to each item if provided
26
+ /// WrapSpacing is reused for the the padding inside the itemDecoration
27
+ /// on the side opposite from the control
26
28
final BoxDecoration ? itemDecoration;
27
29
28
30
/// Creates field to select one value from a list of Radio Widgets
Original file line number Diff line number Diff line change @@ -181,7 +181,9 @@ class GroupedCheckbox<T> extends StatelessWidget {
181
181
182
182
final ControlAffinity controlAffinity;
183
183
184
- /// will be added to each item if provided
184
+ /// A BoxDecoration that is added to each item if provided
185
+ /// WrapSpacing is reused for the the padding inside the itemDecoration
186
+ /// on the side opposite from the control
185
187
final BoxDecoration ? itemDecoration;
186
188
187
189
const GroupedCheckbox ({
@@ -304,6 +306,11 @@ class GroupedCheckbox<T> extends StatelessWidget {
304
306
305
307
if (this .itemDecoration != null ) {
306
308
compositeItem = Container (
309
+ padding: EdgeInsets .only (
310
+ left:
311
+ controlAffinity == ControlAffinity .leading ? 0.0 : wrapSpacing,
312
+ right:
313
+ controlAffinity == ControlAffinity .leading ? wrapSpacing : 0.0 ),
307
314
decoration: this .itemDecoration,
308
315
child: compositeItem,
309
316
);
Original file line number Diff line number Diff line change @@ -172,7 +172,9 @@ class GroupedRadio<T> extends StatefulWidget {
172
172
173
173
final ControlAffinity controlAffinity;
174
174
175
- /// will be added to each item if provided
175
+ /// A BoxDecoration that is added to each item if provided
176
+ /// WrapSpacing is reused for the the padding inside the itemDecoration
177
+ /// on the side opposite from the control
176
178
final BoxDecoration ? itemDecoration;
177
179
178
180
const GroupedRadio ({
@@ -297,6 +299,13 @@ class _GroupedRadioState<T> extends State<GroupedRadio<T?>> {
297
299
if (widget.itemDecoration != null ) {
298
300
compositeItem = Container (
299
301
decoration: widget.itemDecoration,
302
+ padding: EdgeInsets .only (
303
+ left: widget.controlAffinity == ControlAffinity .leading
304
+ ? 0.0
305
+ : widget.wrapSpacing,
306
+ right: widget.controlAffinity == ControlAffinity .leading
307
+ ? widget.wrapSpacing
308
+ : 0.0 ),
300
309
child: compositeItem,
301
310
);
302
311
}
You can’t perform that action at this time.
0 commit comments