mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Fix sliver padding safe area for material gallery (#19497)
This commit is contained in:
parent
48f441723d
commit
d07d6ac36e
@ -245,6 +245,9 @@ class _DemosPage extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
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(
|
return new KeyedSubtree(
|
||||||
key: const ValueKey<String>('GalleryDemoList'), // So the tests can find this ListView
|
key: const ValueKey<String>('GalleryDemoList'), // So the tests can find this ListView
|
||||||
child: new Semantics(
|
child: new Semantics(
|
||||||
@ -254,7 +257,7 @@ class _DemosPage extends StatelessWidget {
|
|||||||
explicitChildNodes: true,
|
explicitChildNodes: true,
|
||||||
child: new ListView(
|
child: new ListView(
|
||||||
key: new PageStorageKey<String>(category.name),
|
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) {
|
children: kGalleryCategoryToDemos[category].map<Widget>((GalleryDemo demo) {
|
||||||
return new _DemoItem(demo: demo);
|
return new _DemoItem(demo: demo);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
|
Loading…
Reference in New Issue
Block a user