Frezyx/group_button

When isRadio is true it starts with first button selected

roberto77mi opened this issue ยท 10 comments

When I user isRadio=true I expect the options to be rendered with all button unselected. That would match how radio buttons work in HTML for example.

Right now, the first option is selected. In the example below, button A is selected automatically.

GroupButton(
            isRadio: true,
            spacing: 10,
            onSelected: (index, isSelected) => setState(
                () => choiceSelectionOutput = widget.optionsOutputText[index]),
            buttons: ["A","B", "C"]
        )

Hello @roberto77mi ๐Ÿ‘‹๐Ÿป

Thank you for this issue !
I create this functionality in this pr

Now your example will work according to the principle that you described.

Hi @Frezyx ,

I'm using the latest version of the plugin, but the functionality OP suggested is still not available for me.

Here is an example :

GroupButton(
  isRadio: true,
  spacing: 10,
  onSelected: (index, isSelected) => print('$index button is selected'),
  buttons: ["Male", "Female"],
),

I want both radio buttons (Male and Female) to be in unselected state when it's first rendered, until user selects an option. Am I missing anything here?

Hello @ramith-ascentic ๐Ÿ‘‹๐Ÿป
I do not published update with this functionality.
I will write you about it.

Now i publish this changes to pub.dev.
Update package version to 2.1.0 and see changes.

Have a good day !

Awesome! Thanks for the update, works great!

@Frezyx I don't know why, but i still have this bug:
image
image

@Frezyx More debbugging here:
image

@Frezyx And it is fixed by #38.