Fix 'All' checkbox not syncing in multi-select example - #452
Merged
AhmedLSayed9 merged 2 commits intoSep 5, 2026
Merged
Conversation
Selecting every individual item in the Multiselect Dropdown with Checkboxes example (README section 4) left the 'All' checkbox unchecked, since it was only ever toggled by tapping 'All' directly. Now the selection handler derives 'All' from whether every real item is selected, so it stays in sync no matter how selection is reached.
Owner
|
@aditya305 Nice catch! Thanks for the PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MultiSelectExample), theAllcheckbox was only ever toggled when tapped directly. Selecting every individual item one by one leftAllvisibly unchecked even though everything was selected.onChangednow derives whetherAllis checked from whether every real item ends up selected, regardless of how that selection was reached (tappingAll, or checking items one by one). Applied identically to the runnable example and the README snippet so they stay in sync.Test plan
multi_select_all_sync_test.dart: selects all 4 items individually and assertsAllbecomes checked, deselecting one unchecks it again, and tappingAllstill clears everything.dart formatandflutter analyzeclean on changed files.flutter test test/examplespasses (existing golden tests unaffected; skipped as before on this platform).