fluttercommunity / fluttercommunity/flutter-draggable-scrollbar

Very slow scrolling performance when used with large list of content

Open
#2 13 comments 6 reactions 0 assignees View on GitHub
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:

![image](https://user-images.githubusercontent.com/40957572/42971576-c1cf1710-8ba4-11e8-8a37-9c54f9d7aad3.png)

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):

![image](https://user-images.githubusercontent.com/40957572/42972022-0cc0fab2-8ba6-11e8-8896-ce81e66340ed.png)

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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.