Skip to content

Conversation

@TahaTesser
Copy link
Member

@TahaTesser TahaTesser commented Mar 15, 2022

fixes #100123

Note

This will land after ToggleButtons refactoring PR (tester finders look for TextButton instead of RawMaterialButton).

Preview

Screen.Recording.2022-03-15.at.11.49.16.mov

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos documentation f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. c: contributor-productivity Team-specific productivity, code health, technical debt. labels Mar 15, 2022
@HansMuller HansMuller self-requested a review March 18, 2022 18:29
@TahaTesser TahaTesser force-pushed the toggle_buttons_example branch 3 times, most recently from fe43c35 to 002a1e8 Compare April 5, 2022 06:38
@TahaTesser TahaTesser requested a review from gspencergoog April 5, 2022 10:15
@TahaTesser TahaTesser force-pushed the toggle_buttons_example branch from a378b33 to ae3954e Compare April 6, 2022 07:35
@TahaTesser TahaTesser requested a review from gspencergoog April 7, 2022 06:52
Comment on lines +78 to +80
Copy link
Contributor

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:

Suggested change
for (int i = 0; i < _selectedFruits.length; i++) {
_selectedFruits[i] = i == index;
}
_selectedFruit = index;

Copy link
Member Author

@TahaTesser TahaTesser Apr 7, 2022

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.

Copy link
Member Author

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

Copy link
Contributor

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.

@TahaTesser TahaTesser requested a review from gspencergoog April 7, 2022 16:00
Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

Comment on lines +78 to +80
Copy link
Contributor

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.

egramond pushed a commit to egramond/flutter that referenced this pull request May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: contributor-productivity Team-specific productivity, code health, technical debt. d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add official example for ToggleButtons showcasing various configurations

3 participants