Unverified Commit 6494dde3 authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

Apply media padding in Gallery Shrine demo (#14506)

Applies horizontal and bottom safe area insets to the Shrine demo in the
Gallery. Top insets are not applied due to the presence of the
omnipresent sliver app bar. Specifically, this ensures that the grid
cards are inset inside the iPhone X notch in horizontal mode, and that
the bottom of the grid is positioned above the iOS home indicator.
parent 8a2df396
...@@ -388,11 +388,10 @@ class _ShrineHomeState extends State<ShrineHome> { ...@@ -388,11 +388,10 @@ class _ShrineHomeState extends State<ShrineHome> {
shoppingCart: _shoppingCart, shoppingCart: _shoppingCart,
body: new CustomScrollView( body: new CustomScrollView(
slivers: <Widget>[ slivers: <Widget>[
new SliverToBoxAdapter( new SliverToBoxAdapter(child: new _Heading(product: featured)),
child: new _Heading(product: featured), new SliverSafeArea(
), top: false,
new SliverPadding( minimum: const EdgeInsets.all(16.0),
padding: const EdgeInsets.all(16.0),
sliver: new SliverGrid( sliver: new SliverGrid(
gridDelegate: gridDelegate, gridDelegate: gridDelegate,
delegate: new SliverChildListDelegate( delegate: new SliverChildListDelegate(
......
...@@ -287,8 +287,9 @@ class _OrderPageState extends State<OrderPage> { ...@@ -287,8 +287,9 @@ class _OrderPageState extends State<OrderPage> {
quantityChanged: (int value) { updateOrder(quantity: value); }, quantityChanged: (int value) { updateOrder(quantity: value); },
), ),
), ),
new SliverPadding( new SliverSafeArea(
padding: const EdgeInsets.fromLTRB(8.0, 32.0, 8.0, 8.0), top: false,
minimum: const EdgeInsets.fromLTRB(8.0, 32.0, 8.0, 8.0),
sliver: new SliverGrid( sliver: new SliverGrid(
gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent( gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: 248.0, maxCrossAxisExtent: 248.0,
......
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