Skip to content

Fix 'All' checkbox not syncing in multi-select example - #452

Merged
AhmedLSayed9 merged 2 commits into
AhmedLSayed9:masterfrom
aditya305:fix/multi-select-all-checkbox-sync
Sep 5, 2026
Merged

Fix 'All' checkbox not syncing in multi-select example#452
AhmedLSayed9 merged 2 commits into
AhmedLSayed9:masterfrom
aditya305:fix/multi-select-all-checkbox-sync

Conversation

@aditya305

Copy link
Copy Markdown
Contributor

Summary

  • In the "Multiselect Dropdown with Checkboxes" example (README section 4 / MultiSelectExample), the All checkbox was only ever toggled when tapped directly. Selecting every individual item one by one left All visibly unchecked even though everything was selected.
  • onChanged now derives whether All is checked from whether every real item ends up selected, regardless of how that selection was reached (tapping All, or checking items one by one). Applied identically to the runnable example and the README snippet so they stay in sync.

Test plan

  • Added multi_select_all_sync_test.dart: selects all 4 items individually and asserts All becomes checked, deselecting one unchecks it again, and tapping All still clears everything.
  • dart format and flutter analyze clean on changed files.
  • flutter test test/examples passes (existing golden tests unaffected; skipped as before on this platform).

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.
@AhmedLSayed9 AhmedLSayed9 added the enhancement New feature or request label Sep 5, 2026
@AhmedLSayed9

Copy link
Copy Markdown
Owner

@aditya305 Nice catch! Thanks for the PR.

@AhmedLSayed9
AhmedLSayed9 merged commit 6286936 into AhmedLSayed9:master Sep 5, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants