Conversation
…nu is open Defer Navigator.removeRoute until after the current frame when orientation changes during build. This ports the reviewed fix from flutter/flutter#187366. Fixes flutter/flutter#171011
There was a problem hiding this comment.
Code Review
This pull request defers the dismissal of the dropdown route during orientation changes if the scheduler is in the persistent callbacks phase, preventing Navigator mutation during the build phase. It also adds a corresponding widget test to verify this behavior and a changelog entry. There are no review comments, and I have no feedback to provide.
Use DropdownButton in the test name so it is easier to find when those tests move to dropdown_button_test.dart.
|
Hi @ishivamg I recently finished up my work for splitting up a relevant test file for DropdownButton To avoid conflicts, I would suggest if you could create the Then I won't have a conflict on |
Place the regression test in its own DropdownButton test file so it does not conflict with the upcoming dropdown_test.dart split.
Moved the regression test into dropdown_button_test.dart as suggested. |
|
Oh, I see see that the PR checklist is missing from this PR (it was present in the older one you ported) I restored the checklist and checked the boxes that are definitely present. Can you cross check if you did the rest of the checklist? |
This PR ports flutter/flutter#187366 to
material_ui.When a
DropdownButtonmenu is open (especially inside a dialog) and the device orientation changes,_DropdownButtonState.build()dismissed the route withNavigator.removeRoute()during build. That triggerssetState() or markNeedsBuild() called during build.The route is now removed synchronously unless we are in
SchedulerPhase.persistentCallbacks, in which case removal is deferred to a post-frame callback.Fixes flutter/flutter#171011
Follows flutter/flutter#188444
Pre-Review Checklist
[shared_preferences]///).