Pipe through View's MediaQueryData to OverlayPortal children#170818
Pipe through View's MediaQueryData to OverlayPortal children#170818Piinks wants to merge 1 commit into
Conversation
| // over the widget tree, may not be aware of obstructions like the software | ||
| // keyboard. This provides the accurate MediaQueryData for the View to the | ||
| // Overlay. | ||
| return MediaQuery.fromView(view: View.of(context), child: portal); |
There was a problem hiding this comment.
We should be getting the MediaQueryData from the Overlay's BuildContext, not the View, since the overlay child will be shown on the Overlay.
OverlayPortal has 2 children. Only the overlay child should see the MediaQueryData from the Overlay, the other child (the regular child) should see the same MediaQueryData as its parent.
Also I think we should only copyWith the padding / viewInset (and whatever is relevant in MediaQueryData). Things like accessibility settings should still be from the parent.
There was a problem hiding this comment.
OverlayPortal has 2 children. Only the overlay child should see the MediaQueryData from the Overlay, the other child (the regular child) should see the same MediaQueryData as its parent.
This part I am not sure I follow, which child is which?
There was a problem hiding this comment.
Here's what I think..
Only the overlay child should see the MediaQueryData from the Overlay,
I think this means overlayChildBuilder
the other child (the regular child) should see the same MediaQueryData as its parent.
I think this means child
There was a problem hiding this comment.
Yeah overlayChildBuilder builds the child that will be shown in the Overlay (as if it was in an OverlayEntry) while child is just like any other Widget.child
There was a problem hiding this comment.
Gotcha gotcha! Thanks!
|
Ah that makes a lot of sense! Thanks! I will update. |
|
Closing to open a fresh PR since it's been a while. |
Part of #142921
Not sure on this approach, this is a new neighborhood for me. :)
Follow up to resolve #142921 will be to incorporate the MediaQueryData into the positioning in _MenuLayout.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.