@@ -217,36 +217,42 @@ class _GroupedRadioState<T> extends State<GroupedRadio<T?>> {
217217 widgetList.add (buildItem (i));
218218 }
219219
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,
229228 children: widgetList,
230229 ),
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+ ),
247253 ),
248- ) ,
249- } ;
254+ } ,
255+ ) ;
250256 }
251257
252258 /// the composite of all the components for the option at index
@@ -255,17 +261,12 @@ class _GroupedRadioState<T> extends State<GroupedRadio<T?>> {
255261 final optionValue = option.value;
256262 final isOptionDisabled = true == widget.disabled? .contains (optionValue);
257263 final control = Radio <T ?>(
258- groupValue: widget.value,
259264 activeColor: widget.activeColor,
260265 focusColor: widget.focusColor,
261266 hoverColor: widget.hoverColor,
262267 materialTapTargetSize: widget.materialTapTargetSize,
263268 value: optionValue,
264- onChanged: isOptionDisabled
265- ? null
266- : (T ? selected) {
267- widget.onChanged (selected);
268- },
269+ enabled: ! isOptionDisabled,
269270 );
270271
271272 final label = GestureDetector (
0 commit comments