You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Long TwoLevelLists have poor performance (due to lack of viewporting) #4765
The app below contains 500 items, 100 of which are ExpansionTiles with 10 children. Scrolling performance on a Nexus 5 seems quite good to me, even after expanding sublists for a while. The ExpansionTiles are created lazily (ListView) and so, unlike TwoLevelList, only the visible ones are built or rendered.
Let me know if this addresses the performance problem you reported. If so, I think we can close this issue.
import 'package:flutter/material.dart';
const int kItemCount = 500;
const int kItemChildCount = 10;
class ExpansionTilePerformance extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: const Text('ExpansionTile'),
),
body: new ListView.builder(
itemCount: kItemCount,
itemBuilder: (BuildContext context, int index) {
final Widget title = new Text('Item $index');
if (index % 5 == 0) {
return new ExpansionTile(
title: title,
key: new ValueKey<int>(index),
children: new List.generate(kItemChildCount, (int childIndex) {
return new ListTile(title: new Text(' Item $index.$childIndex'));
}).toList(),
);
}
return new ListTile(title: title);
},
),
);
}
}
void main() {
runApp(new MaterialApp(home: new ExpansionTilePerformance()));
}
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
Hixie commentedon Jun 27, 2016
Said ideas are at #4430
mehmetf commentedon Mar 13, 2017
Is this fixed with the addition of the new scrolling? I see we have viewporting in ListViews but not sure if TwoLevelLists do this yet.
abarth commentedon Mar 13, 2017
Not fixed yet. The machinery is in place, just not used yet.
eseidelGoogle commentedon Apr 11, 2017
Let us know if this is blocking you. Punting for now. We know how to do this if necessary and have the tools to do it now.
HansMuller commentedon May 12, 2017
The app below contains 500 items, 100 of which are ExpansionTiles with 10 children. Scrolling performance on a Nexus 5 seems quite good to me, even after expanding sublists for a while. The ExpansionTiles are created lazily (ListView) and so, unlike TwoLevelList, only the visible ones are built or rendered.
Let me know if this addresses the performance problem you reported. If so, I think we can close this issue.
mehmetf commentedon May 12, 2017
Yep this will work in the interim if we run into problems.
However as we had talked, the best solution would be the FixedExtent solution with auto-derived extents.
HansMuller commentedon May 12, 2017
Excellent, I'll close this issue. I'm working on adding support for auto-derived extents now.
Roll engine to 9a98143.
Roll engine to b6df7a6.
Roll engine to b6df7a6. (#15444)
Updates for Fuchsia roll. (flutter#4765)
Roll engine to b6df7a6. (flutter#15444)
github-actions commentedon Aug 17, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.