Skip to content

_GroupButtonBodyState.initState() minor bug #61

@slavap

Description

@slavap
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions