@@ -23,7 +23,7 @@ class _DecoratedRadioCheckboxState extends State<DecoratedRadioCheckbox> {
23
23
const SizedBox (height: 20 ),
24
24
// this text appears correctly if the textScaler <> 1.0
25
25
const Text (
26
- 'With itemDecoration- label is a column of Widgets - orientation: wrap - wrapSpacing 5.0' ,
26
+ 'label: column of Widgets itemBorder:true orient: wrap wrapSpacing: 5.0' ,
27
27
textScaler: TextScaler .linear (1.01 )),
28
28
FormBuilderCheckboxGroup (
29
29
name: 'aCheckboxGroup1' ,
@@ -36,7 +36,7 @@ class _DecoratedRadioCheckboxState extends State<DecoratedRadioCheckbox> {
36
36
),
37
37
const SizedBox (height: 20 ),
38
38
const Text (
39
- 'With itemDecoration - label is a column of Widgets - orientation: wrap - wrapSpacing 5.0' ,
39
+ 'label: column of Widgets itemBorder:true orient: wrap wrapSpacing: 5.0' ,
40
40
textScaler: TextScaler .linear (1.01 )),
41
41
FormBuilderCheckboxGroup (
42
42
name: 'aCheckboxGroup2' ,
@@ -50,7 +50,7 @@ class _DecoratedRadioCheckboxState extends State<DecoratedRadioCheckbox> {
50
50
),
51
51
const SizedBox (height: 20 ),
52
52
const Text (
53
- 'With itemDecoration - label is a column of Widgets - orientation: wrap - wrapSpacing 5.0' ,
53
+ 'label: column of Widgets itemBorder:true orient: wrap wrapSpacing: 5.0' ,
54
54
textScaler: TextScaler .linear (1.01 )),
55
55
FormBuilderRadioGroup (
56
56
name: 'aRadioGroup1' ,
@@ -62,8 +62,7 @@ class _DecoratedRadioCheckboxState extends State<DecoratedRadioCheckbox> {
62
62
borderRadius: BorderRadius .circular (5.0 )),
63
63
),
64
64
const SizedBox (height: 20 ),
65
- const Text (
66
- 'With itemDecoration - label is the value - orientation: wrap - wrapSpacing 10.0' ,
65
+ const Text ('label:value itemBorder:true orient:wrap wrapSpacing:10.0' ,
67
66
textScaler: TextScaler .linear (1.01 )),
68
67
FormBuilderRadioGroup (
69
68
name: 'aRadioGroup2' ,
@@ -83,16 +82,15 @@ class _DecoratedRadioCheckboxState extends State<DecoratedRadioCheckbox> {
83
82
),
84
83
const SizedBox (height: 20 ),
85
84
const Text (
86
- 'No itemDecoration - label is the value - orientation: wrap - wrapSpacing 10.0' ,
85
+ 'itemDecoration:false label: value orient: wrap wrapSpacing: 10.0' ,
87
86
textScaler: TextScaler .linear (1.01 )),
88
87
FormBuilderRadioGroup (
89
88
name: 'aRadioGroup3' ,
90
89
options: getDemoOptions (),
91
90
wrapSpacing: 10.0 ,
92
91
),
93
92
const SizedBox (height: 20 ),
94
- const Text (
95
- 'With itemDecoration - orientation: horiz - no border - wrapSpacing 5.0' ,
93
+ const Text ('orient:horiz itemBorder:false wrapSpacing:5.0' ,
96
94
textScaler: TextScaler .linear (1.01 )),
97
95
FormBuilderCheckboxGroup (
98
96
name: 'aCheckboxGroup3' ,
@@ -105,8 +103,7 @@ class _DecoratedRadioCheckboxState extends State<DecoratedRadioCheckbox> {
105
103
borderRadius: BorderRadius .circular (5.0 )),
106
104
),
107
105
const SizedBox (height: 20 ),
108
- const Text (
109
- 'With itemDecoration - orientation: vert - with border - wrapSpacing 5.0' ,
106
+ const Text ('orient:vert itemBorder:true wrapSpacing:5.0' ,
110
107
textScaler: TextScaler .linear (1.01 )),
111
108
FormBuilderCheckboxGroup (
112
109
name: 'aCheckboxGroup3' ,
@@ -120,11 +117,11 @@ class _DecoratedRadioCheckboxState extends State<DecoratedRadioCheckbox> {
120
117
),
121
118
const SizedBox (height: 20 ),
122
119
const Text (
123
- 'With itemDecoration - orientation: vert - with border - wrapSpacing 5.0' ,
120
+ 'label:w/sizebox orient: vert itemBorder:true wrapSpacing: 5.0' ,
124
121
textScaler: TextScaler .linear (1.01 )),
125
122
FormBuilderRadioGroup (
126
123
name: 'aRadioGroup4' ,
127
- options: getDemoOptionsWidgets (),
124
+ options: getDemoOptionsWidgets (forceMinWidth : 80.0 ),
128
125
wrapSpacing: 5.0 ,
129
126
orientation: OptionsOrientation .vertical,
130
127
itemDecoration: BoxDecoration (
@@ -138,24 +135,51 @@ class _DecoratedRadioCheckboxState extends State<DecoratedRadioCheckbox> {
138
135
}
139
136
140
137
/// options using column of widgets for the label
141
- List <FormBuilderFieldOption > getDemoOptionsWidgets () {
142
- return const [
138
+ /// We can force a min width by creating a sized box so we don't need another parameter
139
+ List <FormBuilderFieldOption > getDemoOptionsWidgets ({forceMinWidth = 0.0 }) {
140
+ return [
143
141
FormBuilderFieldOption (
144
- value: "airplane" ,
145
- child: Column (
146
- children: [Text ("Airplane" ), Icon (Icons .airplanemode_on)],
147
- )),
142
+ value: "airplane" ,
143
+ child: Container (
144
+ padding: const EdgeInsets .all (5.0 ),
145
+ child: Column (
146
+ children: [
147
+ const Text ("Airplane" ),
148
+ const Icon (Icons .airplanemode_on),
149
+ SizedBox (width: forceMinWidth, height: 0.0 ),
150
+ ],
151
+ )),
152
+ ),
148
153
FormBuilderFieldOption (
149
- value: "fire-truck" ,
150
- child:
151
- Column (children: [Text ("Fire Truck" ), Icon (Icons .fire_truck)])),
154
+ value: "fire-truck" ,
155
+ child: Container (
156
+ padding: const EdgeInsets .all (5.0 ),
157
+ child: Column (children: [
158
+ const Text ("Fire Truck" ),
159
+ const Icon (Icons .fire_truck),
160
+ SizedBox (width: forceMinWidth, height: 0.0 ),
161
+ ])),
162
+ ),
152
163
FormBuilderFieldOption (
153
- value: "bus-alert" ,
154
- child: Column (children: [Text ("Bus Alert" ), Icon (Icons .bus_alert)])),
164
+ value: "bus-alert" ,
165
+ child: Container (
166
+ padding: const EdgeInsets .all (5.0 ),
167
+ child: Column (children: [
168
+ const Text ("Bus Alert" ),
169
+ const Icon (Icons .bus_alert),
170
+ SizedBox (width: forceMinWidth, height: 0.0 ),
171
+ ])),
172
+ ),
155
173
FormBuilderFieldOption (
156
- value: "firetruck" ,
157
- child:
158
- Column (children: [Text ("Motorcycle" ), Icon (Icons .motorcycle)])),
174
+ value: "firetruck" ,
175
+ child: Container (
176
+ padding: const EdgeInsets .all (5.0 ),
177
+ child: Column (children: [
178
+ const Text ("Motorcycle" ),
179
+ const Icon (Icons .motorcycle),
180
+ SizedBox (width: forceMinWidth, height: 0.0 ),
181
+ ])),
182
+ ),
159
183
];
160
184
}
161
185
0 commit comments