)]}'
{
  "commit": "b2dc66b8d398bda596f5fba2288a94eafc86ab86",
  "tree": "63d4a2c98802b186bddfe7a1f8328c6bfc51b6e0",
  "parents": [
    "0e2a6b99828c9d3e8883775cea7b459ca58e9c13"
  ],
  "author": {
    "name": "Ahmed Elsayed",
    "email": "ahmedelsaayid@gmail.com",
    "time": "Thu Mar 19 01:02:35 2026 +0200"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Mar 18 23:02:35 2026 +0000"
  },
  "message": "Fix Semantics expanded state not updating in PopupMenuButton and DropdownButton (#183475)\n\nFixes #183432\n\n## Description\n\n`_isMenuExpanded` is updated without calling `setState()` in both\n`PopupMenuButton` and `DropdownButton`, so the `Semantics(expanded:\n_isMenuExpanded)` widget doesn\u0027t rebuild.\n\n**`PopupMenuButton`**: The `expanded` state never updates at all since\nthere is no `setState()` call anywhere in `PopupMenuButtonState`.\n\n**`DropdownButton`**: Currently masked by `_handleFocusChanged`, which\nhappens to call `setState()` whenever focus changes on open/close, but\nshould not rely on this side effect.\n\n### Changes\n\n- Wrapped `_isMenuExpanded` assignments with `setState()` in both\nwidgets.\n- For `DropdownButton`, moved `_isMenuExpanded \u003d false` from\n`_removeDropdownRoute()` to the `.then()` callback with a `mounted`\nguard. This avoids unnecessary `setState()` calls when\n`_removeDropdownRoute()` is invoked during `dispose()` or orientation\nchanges in `build()`, where the menu state isn\u0027t actually changing from\nuser interaction.\n\n## Tests\n\nAdded regression tests for both `PopupMenuButton` and `DropdownButton`\nto verify the `expanded` semantics state updates correctly when the menu\nopens and closes.\n\n## Pre-launch Checklist\n\n- [x] I read the [Contributor Guide] and followed the process outlined\nthere for submitting PRs.\n- [x] I read the [AI contribution guidelines] and understand my\nresponsibilities, or I am not using AI tools.\n- [x] I read the [Tree Hygiene] wiki page, which explains my\nresponsibilities.\n- [x] I read and followed the [Flutter Style Guide], including [Features\nwe expect every widget to implement].\n- [x] I signed the [CLA].\n- [x] I listed at least one issue that this PR fixes in the description\nabove.\n- [x] I updated/added relevant documentation (doc comments with `///`).\n- [x] I added new tests to check the change I am making, or this PR is\n[test-exempt].\n- [x] I followed the [breaking change policy] and added [Data Driven\nFixes] where supported.\n- [x] All existing and new tests are passing.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "fcca1abe11e1d69a350a886cedd0c6d8dcc70e58",
      "old_mode": 33188,
      "old_path": "packages/flutter/lib/src/material/dropdown.dart",
      "new_id": "a1624ed050a85c90a12035a86c2f745a2452ef62",
      "new_mode": 33188,
      "new_path": "packages/flutter/lib/src/material/dropdown.dart"
    },
    {
      "type": "modify",
      "old_id": "5e3e7a23d7437661fe3433560ed417516786bf55",
      "old_mode": 33188,
      "old_path": "packages/flutter/lib/src/material/popup_menu.dart",
      "new_id": "8b84b2760d59c5f2e1a73ff7fd823c92ad01a417",
      "new_mode": 33188,
      "new_path": "packages/flutter/lib/src/material/popup_menu.dart"
    },
    {
      "type": "modify",
      "old_id": "c03cbf4f2b7a3e836003683f1f587c5db8d7eb0a",
      "old_mode": 33188,
      "old_path": "packages/flutter/test/material/dropdown_test.dart",
      "new_id": "df05dbeaeed523e466d668eeedbda36d49f5526c",
      "new_mode": 33188,
      "new_path": "packages/flutter/test/material/dropdown_test.dart"
    },
    {
      "type": "modify",
      "old_id": "137641158cc42bc0f7a1a77d8f5cd89a19deb1fc",
      "old_mode": 33188,
      "old_path": "packages/flutter/test/material/popup_menu_test.dart",
      "new_id": "c26da064da5b491a94ee7d006a2c2cd2d4645213",
      "new_mode": 33188,
      "new_path": "packages/flutter/test/material/popup_menu_test.dart"
    }
  ]
}
