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.
This commit is contained in:
Chris Bracken
2018-01-02 14:09:32 -08:00
committed by GitHub
parent 882eb24e1e
commit ece737d145
2 changed files with 11 additions and 7 deletions

View File

@@ -610,12 +610,16 @@ class _AnimationDemoHomeState extends State<AnimationDemoHome> {
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);
}
),
),
),
),

View File

@@ -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(