Wrap PopupMenu with SafeArea to respect status bar#64678
Conversation
|
Hey @JuYeong0413 Can you share some sample code that reproduces the behavior in your images above? I have been looking at these tests and I suspect they may be failing because it is not quite working as expected. Thanks! |
|
Ah I've put the reproducible code gist link in the design doc, but found out the link was broken. Sorry. |
|
Sorry for the delay @JuYeong0413 I've been away. This is on my list to review today. :) |
|
It's okay, there's no rush. :) I know the Flutter team has a lot of works to do. Take your time. |
|
I cannot sort out why the mocked-up media queries in your tests are not working as expected. Let me see if I can recruit a second opinion. |
|
Hey @JuYeong0413 I forgot that the Popup menu is in a different overlay entry, so if you use MaterialApp.builder and place your media query there it should work. I found a test that you can use as an example to update your test: Let me know how this works out for you! |
|
Thank you very much for your help @Piinks, using |
This reverts commit 2e419ff.

Description
Continuous work of #55489
Currently,
PopupMenudoes not respect the system status bar and bottom notch.Wrapping
PopupMenuwithSafeAreawould solve this problem.Related Issues
Fixes #19954
Tests
I added the following tests:
PopupMenuinAppBardoes not overlap with the status barPopupMenudoes not overlap with the status bar and bottom notchHowever, new tests are failing.
I have created
MediaQuery.datafor mimicking status bar and bottom notch, but the results are same before&after wrappingPopupMenuwithSafeArea.Executing the same widgets on the emulator works as expected, so I think there's some problem with
MediaQueryDataor getting y offset ofPopupMenuin my test code. (BTW, usingMediaQueryData.viewInsetsandMediaQueryData.viewPaddingboth give me the same result when representing the status bar... I thinkMediaQueryData.viewInsetsmay be correct.)cc/ @Piinks
Checklist
Before you create this PR, confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.