fluttercommunity / fluttercommunity/flutter-draggable-scrollbar
Scrollbar length calculated incorrectly when different widgets inside ListView
- Dominant language
- Dart
- Stars
- 442
- Forks
- 72
- PR merge metrics
- No merged PRs in 30d
Description
# Summary
I have a ListView.builder with two widgets as children. One of them is a Widget RichText that has many TextSpan children inside. The other is just a RaisedButton.
## Expected
I hoped that the Scrollbar length would be dragged through the whole list.
## What actually happens
Around the middle of the scrollbar length, the list already reaches the end.
## Code
```dart
DraggableScrollbar.semicircle(
controller: _scrollController,
child: ListView.builder(
controller: _scrollController,
itemCount: _listWidgets.length,
itemBuilder: (context, index) {
return _listWidgets[index];
},
),
),
```
```dart
List listWidgets(CcbDataPreview ccbDataPreview) {
List _list = [];
CcbData _ccbData = CcbData(
ccbDataPreview: ccbDataPreview,
invertTextColors: true,
);
_list.add(_ccbData.clausesAndParagraphs);
_list.add(cancelCcbButton());
return _list;
}
```
cancelCcbButton is just an implementation of a RaisedButton.
## Screenshots
At this point, the list is already at its end, but scrollbar in the middle.

As you can see, it's the same screen, and now the scroll was just dragged to the end, without any movement in the screen.

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.