-
Notifications
You must be signed in to change notification settings - Fork 461
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
[scrollable_positioned_list] Expose ScrollController to be observed by Scrollbar #305
base: master
Are you sure you want to change the base?
Conversation
…troller so that it can be observer by ScrollBars. This also allows passing the scrollController to the ItemScrollController. Pass the scrollController from the itemController inside the ListDisplayDetail Specify ScrollController type Use late to specifically assign ListDisplayDetails to primary and secondary Signed-off-by: Nabil Mosharraf <nabil.mosharraf@photobookworldwide.com>
@tarobins please have a look at this PR at your convenience |
Has this been well tested in the use case you are trying it with? Does the scrollbar behave as expected when you jump around etc? |
I used the above code into your example main.dart and wrapped the ScrollablePositionedList with the Scrollbar. Here are the results: Horizontal around 30 Horizontal around 100 Vertical around 1000 Vertical around 5000 According to my manual tests, both jump and scroll to also works fine and the scroll bar automatically is updated. |
I incorporated this change into my project and it's working pretty well. |
It looked like working, but when performing a long distance scroll my listener seems to have lost track of the scroll. |
Hi. Any progress on this? |
I am happily using it in my app after forking, depends on the authors to decide if they want to merge this or not. |
There is a problem with exposed scrollController. |
@korvan As long as that is properly documented in-code (so on But I would like to be able to scroll a precise number of pixels, and for that I need access to ScrollController. It could also be added as another API to ItemScrollController (ie jumpToPixel for example). |
In my case, I required exposing the scrollController to jump to a position and also use it with a custom ScrollBar such as DraggableScrollbar. Thats the reason for me to create this PR, in order to expose it for whatever requirements we need. |
@nabil6391 Ah of course, that makes sense then. |
Will this be merged eventually @tarobins? |
👁️ |
Description
This PR exposes the primary listview's scrollController inside the ScrollablePositionedList from the ItemScrollController so that it can be observer by ScrollBars.
This also allows passing the scrollController to the ItemScrollController.
As a result we will finally be able to use like this
Related Issues
#273
#303
#278
#235
#175
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.flutter test
pass.flutter analyze
does not report any problems on my PR.