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.
This commit is contained in:
Chris Bracken 2018-02-06 15:54:10 -08:00 committed by GitHub
parent 8a2df39662
commit 6494dde364
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -388,11 +388,10 @@ class _ShrineHomeState extends State<ShrineHome> {
shoppingCart: _shoppingCart,
body: new CustomScrollView(
slivers: <Widget>[
new SliverToBoxAdapter(
child: new _Heading(product: featured),
),
new SliverPadding(
padding: const EdgeInsets.all(16.0),
new SliverToBoxAdapter(child: new _Heading(product: featured)),
new SliverSafeArea(
top: false,
minimum: const EdgeInsets.all(16.0),
sliver: new SliverGrid(
gridDelegate: gridDelegate,
delegate: new SliverChildListDelegate(

View File

@ -287,8 +287,9 @@ class _OrderPageState extends State<OrderPage> {
quantityChanged: (int value) { updateOrder(quantity: value); },
),
),
new SliverPadding(
padding: const EdgeInsets.fromLTRB(8.0, 32.0, 8.0, 8.0),
new SliverSafeArea(
top: false,
minimum: const EdgeInsets.fromLTRB(8.0, 32.0, 8.0, 8.0),
sliver: new SliverGrid(
gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: 248.0,