ToggleButtons: Add interactive example#100124
ToggleButtons: Add interactive example#100124fluttergithubbot merged 2 commits intoflutter:masterfrom
ToggleButtons: Add interactive example#100124Conversation
fe43c35 to
002a1e8
Compare
a378b33 to
ae3954e
Compare
There was a problem hiding this comment.
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.
ToggleButton expects a list of bools required List<bool> isSelected, to set the selected items.
There was a problem hiding this comment.
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.
Ahh, nevermind then. Sorry, I didn't realize that the ToggleButtons API took a bool list.
There was a problem hiding this comment.
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.