_GroupButtonBodyState.initState() minor bug
slavap opened this issue · comments
Slava P. commented
class _GroupButtonBodyState extends State<GroupButtonBody> {
@override
void initState() {
super.initState();
if (!widget.isRadio) {
widget.controller.toggleIndexes(widget.selectedButtons ?? []); // <<< has to be selectIndexes
}
Because the following code is not working properly:
GroupButton(
selectedButtons: selected,
controller: GroupButtonController()..selectIndexes(selected),
It's oversimplified example, the point is that you cannot set properly synchronized selectedButtons and controller.