Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrollbar length calculated incorrectly when different widgets inside ListView #25

Open
isorensen opened this issue Apr 7, 2020 · 0 comments

Comments

@isorensen
Copy link

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

DraggableScrollbar.semicircle(
                              controller: _scrollController,
                              child: ListView.builder(
                                controller: _scrollController,
                                itemCount: _listWidgets.length,
                                itemBuilder: (context, index) {
                                  return _listWidgets[index];
                                },
                              ),
                            ),
List<Widget> listWidgets(CcbDataPreview ccbDataPreview) {
    List<Widget> _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.
image

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.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant