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.
Because the following code is not working properly:
It's oversimplified example, the point is that you cannot set properly synchronized selectedButtons and controller.