From d07d6ac36e4ac5018e221bd9affee19d355a3b7a Mon Sep 17 00:00:00 2001 From: xster Date: Wed, 18 Jul 2018 15:46:51 -0700 Subject: [PATCH] Fix sliver padding safe area for material gallery (#19497) --- examples/flutter_gallery/lib/gallery/home.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/flutter_gallery/lib/gallery/home.dart b/examples/flutter_gallery/lib/gallery/home.dart index e668119636d..fa8fcd6793b 100644 --- a/examples/flutter_gallery/lib/gallery/home.dart +++ b/examples/flutter_gallery/lib/gallery/home.dart @@ -245,6 +245,9 @@ class _DemosPage extends StatelessWidget { @override Widget build(BuildContext context) { + // When overriding ListView.padding, it's necessary to manually handle + // safe areas. + final double windowBottomPadding = MediaQuery.of(context).padding.bottom; return new KeyedSubtree( key: const ValueKey('GalleryDemoList'), // So the tests can find this ListView child: new Semantics( @@ -254,7 +257,7 @@ class _DemosPage extends StatelessWidget { explicitChildNodes: true, child: new ListView( key: new PageStorageKey(category.name), - padding: const EdgeInsets.only(top: 8.0), + padding: new EdgeInsets.only(top: 8.0, bottom: windowBottomPadding), children: kGalleryCategoryToDemos[category].map((GalleryDemo demo) { return new _DemoItem(demo: demo); }).toList(),