Unverified Commit e478a547 authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

Apply media padding in Gallery Pesto demo (#13668)

Applies horizontal safe area insets to the Pesto demo in the Gallery.
This is to support the iPhone X sensor housing notch and other similarly
creative display features when in landscape orientation.
parent 37f216bf
......@@ -137,7 +137,13 @@ class _RecipeGridPageState extends State<RecipeGridPage> {
}
Widget _buildBody(BuildContext context, double statusBarHeight) {
final EdgeInsets padding = const EdgeInsets.all(8.0);
final EdgeInsets mediaPadding = MediaQuery.of(context).padding;
final EdgeInsets padding = new EdgeInsets.only(
top: 8.0,
left: 8.0 + mediaPadding.left,
right: 8.0 + mediaPadding.right,
bottom: 8.0
);
return new SliverPadding(
padding: padding,
sliver: new SliverGrid(
......@@ -432,6 +438,9 @@ class RecipeSheet extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new Material(
child: new SafeArea(
top: false,
bottom: false,
child: new Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 40.0),
child: new Table(
......@@ -497,6 +506,7 @@ class RecipeSheet extends StatelessWidget {
)),
),
),
),
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment