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 { ...@@ -90,7 +90,23 @@ class ComplexLayout extends StatefulWidget {
class ComplexLayoutState extends State<ComplexLayout> { class ComplexLayoutState extends State<ComplexLayout> {
@override @override
Widget build(BuildContext context) { 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( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: const Text('Advanced Layout'), title: const Text('Advanced Layout'),
...@@ -107,21 +123,7 @@ class ComplexLayoutState extends State<ComplexLayout> { ...@@ -107,21 +123,7 @@ class ComplexLayoutState extends State<ComplexLayout> {
), ),
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(child: body),
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));
}
},
),
),
const BottomBar(), 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