-
-
Notifications
You must be signed in to change notification settings - Fork 504
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Update RadioButton to use Flutter's RawRadio under the hood. We already implement RawScrollbar and the goal is to implement most of the flutter ˜Raw˜ widgets available.
Currently, RadioButton is used like this to create a radio group:
int? selected;
Column(
children: List.generate(3, (index) {
return RadioButton(
checked: selected == index,
onChanged: (checked) {
if (checked) {
setState(() => selected = index);
}
}
);
}),
)The API should be changed to the following:
int? index;
RadioGroup<int>(
groupValue: index,
onChanged: (v) => setState(() => index = v),
child: Column(children: [
RadioButton<int>(value: 0),
RadioButton<int>(value: 1),
RadioButton<int>(value: 2),
]),
)Copilot
Metadata
Metadata
Labels
enhancementNew feature or requestNew feature or request