From ece737d1450b3aa5cee0235742116d468bba8856 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Tue, 2 Jan 2018 14:09:32 -0800 Subject: [PATCH] Apply media padding to Gallery animation demo (#13853) Applies horizontal safe area insets to the animation demo in the Gallery. Specifically, this ensures the back button is positioned consistently with iOS expectations and that that main image card in the detail view respects safe area insets. This is to support the iPhone X sensor housing notch and other similarly creative display features when in landscape orientation. --- .../flutter_gallery/lib/demo/animation/home.dart | 16 ++++++++++------ .../lib/demo/animation/widgets.dart | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/examples/flutter_gallery/lib/demo/animation/home.dart b/examples/flutter_gallery/lib/demo/animation/home.dart index 05b8d36d97..a2fe95d5ee 100644 --- a/examples/flutter_gallery/lib/demo/animation/home.dart +++ b/examples/flutter_gallery/lib/demo/animation/home.dart @@ -610,12 +610,16 @@ class _AnimationDemoHomeState extends State { left: 0.0, child: new IconTheme( data: const IconThemeData(color: Colors.white), - child: new IconButton( - icon: const BackButtonIcon(), - tooltip: 'Back', - onPressed: () { - _handleBackButton(appBarMidScrollOffset); - } + child: new SafeArea( + top: false, + bottom: false, + child: new IconButton( + icon: const BackButtonIcon(), + tooltip: 'Back', + onPressed: () { + _handleBackButton(appBarMidScrollOffset); + } + ), ), ), ), diff --git a/examples/flutter_gallery/lib/demo/animation/widgets.dart b/examples/flutter_gallery/lib/demo/animation/widgets.dart index 6404201c0f..13791a348d 100644 --- a/examples/flutter_gallery/lib/demo/animation/widgets.dart +++ b/examples/flutter_gallery/lib/demo/animation/widgets.dart @@ -142,7 +142,7 @@ class SectionDetailView extends StatelessWidget { item = new Container( height: 240.0, padding: const EdgeInsets.all(16.0), - child: image, + child: new SafeArea(top: false, bottom:false, child: image), ); } else { item = new ListTile(