-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listfound in release: 3.16Found to occur in 3.16Found to occur in 3.16found in release: 3.17Found to occur in 3.17Found to occur in 3.17frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Steps to reproduce
- Wrap a fullscreen
OverlayPortalinSafeArea - Use an overlay entry wrapped in
SafeAreawith a Container with a solid color as a child - Show the overlay entry
Expected results
The entry covers all the screen except the system intrusions (eg the system bar)
Actual results
The entry covers the entire screen
This is because the overlay entry inherits context from OverlayPortal which is wrapped in a SafeArea and thus has no system intrusions in its inherited MediaQuery. However, the entry is actually drawn in the nearest Overlay stack which is ABOVE the SafeArea and thus does have system intrusions.
The entry should inherit the Portal's MediaQuery, not just its constraints.
Code sample
Code sample
class OverlayPortalDemo extends StatefulWidget {
const OverlayPortalDemo({super.key});
@override
State<OverlayPortalDemo> createState() => _OverlayPortalDemoState();
}
class _OverlayPortalDemoState extends State<OverlayPortalDemo> {
final OverlayPortalController controller = OverlayPortalController();
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
backgroundColor: Colors.blue,
body: SafeArea(
child: OverlayPortal(
controller: controller,
overlayChildBuilder: (BuildContext context) {
return Container(
color: Colors.red,
);
},
child: Center(
child: ElevatedButton(
onPressed: () {
controller.toggle();
},
child: Text('show portal'),
),
),
),
),
),
);
}
}
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
[Paste your output here]Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listfound in release: 3.16Found to occur in 3.16Found to occur in 3.16found in release: 3.17Found to occur in 3.17Found to occur in 3.17frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team