Unverified Commit e36e9ca0 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

nest list views for bad scroll (#110373)

parent 056f1106
......@@ -90,7 +90,23 @@ class ComplexLayout extends StatefulWidget {
class ComplexLayoutState extends State<ComplexLayout> {
@override
Widget build(BuildContext context) {
print(widget.badScroll);
Widget body = ListView.builder(
key: const Key('complex-scroll'), // this key is used by the driver test
controller: ScrollController(), // So that the scroll offset can be tracked
itemCount: widget.badScroll ? 500 : null,
shrinkWrap: widget.badScroll,
itemBuilder: (BuildContext context, int index) {
if (index.isEven) {
return FancyImageItem(index, key: PageStorageKey<int>(index));
} else {
return FancyGalleryItem(index, key: PageStorageKey<int>(index));
}
},
);
if (widget.badScroll) {
body = ListView(children: <Widget>[body]);
}
return Scaffold(
appBar: AppBar(
title: const Text('Advanced Layout'),
......@@ -107,21 +123,7 @@ class ComplexLayoutState extends State<ComplexLayout> {
),
body: Column(
children: <Widget>[
Expanded(
child: ListView.builder(
key: const Key('complex-scroll'), // this key is used by the driver test
controller: ScrollController(), // So that the scroll offset can be tracked
itemCount: widget.badScroll ? 500 : null,
shrinkWrap: widget.badScroll,
itemBuilder: (BuildContext context, int index) {
if (index.isEven) {
return FancyImageItem(index, key: PageStorageKey<int>(index));
} else {
return FancyGalleryItem(index, key: PageStorageKey<int>(index));
}
},
),
),
Expanded(child: body),
const BottomBar(),
],
),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment