@@ -217,36 +217,42 @@ class _GroupedRadioState<T> extends State<GroupedRadio<T?>> {
217
217
widgetList.add (buildItem (i));
218
218
}
219
219
220
- return switch (widget.orientation) {
221
- OptionsOrientation .auto => OverflowBar (
222
- alignment: MainAxisAlignment .spaceEvenly,
223
- children: widgetList,
224
- ),
225
- OptionsOrientation .vertical => SingleChildScrollView (
226
- scrollDirection: Axis .vertical,
227
- child: Column (
228
- crossAxisAlignment: CrossAxisAlignment .start,
220
+ return RadioGroup <T ?>(
221
+ onChanged: (value) {
222
+ widget.onChanged (value);
223
+ },
224
+ groupValue: widget.value,
225
+ child: switch (widget.orientation) {
226
+ OptionsOrientation .auto => OverflowBar (
227
+ alignment: MainAxisAlignment .spaceEvenly,
229
228
children: widgetList,
230
229
),
231
- ),
232
- OptionsOrientation .horizontal => SingleChildScrollView (
233
- scrollDirection: Axis .horizontal,
234
- child: Row (children: widgetList),
235
- ),
236
- OptionsOrientation .wrap => SingleChildScrollView (
237
- child: Wrap (
238
- spacing: widget.wrapSpacing,
239
- runSpacing: widget.wrapRunSpacing,
240
- textDirection: widget.wrapTextDirection,
241
- crossAxisAlignment: widget.wrapCrossAxisAlignment,
242
- verticalDirection: widget.wrapVerticalDirection,
243
- alignment: widget.wrapAlignment,
244
- direction: Axis .horizontal,
245
- runAlignment: widget.wrapRunAlignment,
246
- children: widgetList,
230
+ OptionsOrientation .vertical => SingleChildScrollView (
231
+ scrollDirection: Axis .vertical,
232
+ child: Column (
233
+ crossAxisAlignment: CrossAxisAlignment .start,
234
+ children: widgetList,
235
+ ),
236
+ ),
237
+ OptionsOrientation .horizontal => SingleChildScrollView (
238
+ scrollDirection: Axis .horizontal,
239
+ child: Row (children: widgetList),
240
+ ),
241
+ OptionsOrientation .wrap => SingleChildScrollView (
242
+ child: Wrap (
243
+ spacing: widget.wrapSpacing,
244
+ runSpacing: widget.wrapRunSpacing,
245
+ textDirection: widget.wrapTextDirection,
246
+ crossAxisAlignment: widget.wrapCrossAxisAlignment,
247
+ verticalDirection: widget.wrapVerticalDirection,
248
+ alignment: widget.wrapAlignment,
249
+ direction: Axis .horizontal,
250
+ runAlignment: widget.wrapRunAlignment,
251
+ children: widgetList,
252
+ ),
247
253
),
248
- ) ,
249
- } ;
254
+ } ,
255
+ ) ;
250
256
}
251
257
252
258
/// the composite of all the components for the option at index
@@ -255,17 +261,12 @@ class _GroupedRadioState<T> extends State<GroupedRadio<T?>> {
255
261
final optionValue = option.value;
256
262
final isOptionDisabled = true == widget.disabled? .contains (optionValue);
257
263
final control = Radio <T ?>(
258
- groupValue: widget.value,
259
264
activeColor: widget.activeColor,
260
265
focusColor: widget.focusColor,
261
266
hoverColor: widget.hoverColor,
262
267
materialTapTargetSize: widget.materialTapTargetSize,
263
268
value: optionValue,
264
- onChanged: isOptionDisabled
265
- ? null
266
- : (T ? selected) {
267
- widget.onChanged (selected);
268
- },
269
+ enabled: ! isOptionDisabled,
269
270
);
270
271
271
272
final label = GestureDetector (
0 commit comments