-
Notifications
You must be signed in to change notification settings - Fork 29.7k
ToggleButtons: Add interactive example
#100124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ToggleButtons: Add interactive example
#100124
Conversation
fe43c35 to
002a1e8
Compare
a378b33 to
ae3954e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, that is simpler, which is good, but I was thinking of _selectedFruits being an int containing the selected fruit, which is even simpler:
| for (int i = 0; i < _selectedFruits.length; i++) { | |
| _selectedFruits[i] = i == index; | |
| } | |
| _selectedFruit = index; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ToggleButton expects a list of bools required List<bool> isSelected, to set the selected items.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bool list is checked for index to select or unselect, if _selectedFruits is just int then It would have to be converted to a bool list for isSelected parameter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, nevermind then. Sorry, I didn't realize that the ToggleButtons API took a bool list.
gspencergoog
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, nevermind then. Sorry, I didn't realize that the ToggleButtons API took a bool list.
ae3954e to
ab9d079
Compare

fixes #100123
Note
This will land after
ToggleButtonsrefactoring PR (tester finders look forTextButtoninstead ofRawMaterialButton).Preview
Screen.Recording.2022-03-15.at.11.49.16.mov
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.