Fix sliver padding safe area for material gallery (#19497)

This commit is contained in:
xster 2018-07-18 15:46:51 -07:00 committed by GitHub
parent 48f441723d
commit d07d6ac36e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<String>('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<String>(category.name),
padding: const EdgeInsets.only(top: 8.0),
padding: new EdgeInsets.only(top: 8.0, bottom: windowBottomPadding),
children: kGalleryCategoryToDemos[category].map<Widget>((GalleryDemo demo) {
return new _DemoItem(demo: demo);
}).toList(),