fluttercommunity / fluttercommunity/flutter-draggable-scrollbar
Very slow scrolling performance when used with large list of content
- Dominant language
- Dart
- Stars
- 442
- Forks
- 72
- PR merge metrics
- No merged PRs in 30d
Description
Hey,
Thanks for putting this library together - exactly what I was looking for!
I'm currently building an app that displays a `ListView` with a lot of content (>10,000 items) and I'm running into some performance issues. The list itself is fine and runs at 60fps while being scrolled without using the scrollbar - even at excessive speed. When I try using the Draggable Scrollbar I notice the following spike on the performance profiler:

Performance drops to 2.1fps.
Even when there are only 500 items in the list there are still fairly a significant number of frames dropped (down to ~40fps):

The list becomes incredibly slow to scroll - the screen often locks up and it can take quite a while to recover. I'm just trying to display a letter alongside an alphabetically sorted list of names - following the instruction provided in #1 .
```
return DraggableScrollbar.semicircle(
labelConstraints:
BoxConstraints.tightFor(width: 80.0, height: 30.0),
labelTextBuilder: (offset) {
final int currentItem = offset ~/ 48.0;
var letter = filteredNames[currentItem].name.substring(0,1);
return Text("$letter");
},
child: ListView.builder(
controller: _semicircleController,
itemCount: filteredNames.length,
itemBuilder: (BuildContext context, int index) {
return NameListItem('${filteredNames[index].name}', gender);
}),
controller: _semicircleController);
```
Is there something wrong with my approach or am I working this component too hard?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.