Flutter RadioGroupPolicy can't be used for a radio group that allows multiple selection

4 days ago 8
ARTICLE AD BOX

I'm trying to migrate to the new RadioGroup API. But I'm getting this error:

RadioGroupPolicy can't be used for a radio group that allows multiple selection.

Here is my current code 👇

RadioGroup( groupValue: value, onChanged: (val) { groupValue.value = val ?? 0; globalLog("value inside radio$val"); }, child: Wrap( alignment: WrapAlignment.spaceBetween, children: List.generate(length, (int index) { return Row( mainAxisSize: MainAxisSize.min, children: [ Radio<int>( toggleable: true, key: Key("$index"), value: isLoading ? 0 : index, backgroundColor: WidgetStateProperty.resolveWith(( states, ) { if (!states.contains(WidgetState.selected)) { return sl<AppColors>().white; } return null; }), activeColor: sl<AppColors>().primaryColor, side: BorderSide( color: sl<AppColors>().primaryColor, width: 1.5, ), ), CustomTextApp( text: isLoading ? "isLoading" : snapshot.data[index][LanguageTable.name], color: sl<AppColors>().black, font: FontWeight.w500, size: Font.fontSizeMedium12, ), ], ); }), ), )

I already checked this GitHub issue and the comments, but it didn’t fix the problem: RadioButton

But the issue still persists. Has anyone else faced this or knows how to fix it?

Read Entire Article