Uh oh!
There was an error while loading. Please reload this page.
[scrollable_positioned_list] Expose ScrollController to be observed by Scrollbar - #305
[scrollable_positioned_list] Expose ScrollController to be observed by Scrollbar#305nabil6391 wants to merge 1 commit into
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 |
tarobins
commented
Nov 17, 2021
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. |
yokemuratakeshi
commented
Nov 29, 2021
I incorporated this change into my project and it's working pretty well. |
yokemuratakeshi
commented
Nov 29, 2021
It looked like working, but when performing a long distance scroll my listener seems to have lost track of the scroll. |
lff5
commented
Jan 3, 2022
Hi. Any progress on this? |
nabil6391
commented
Jan 4, 2022
I am happily using it in my app after forking, depends on the authors to decide if they want to merge this or not. |
korvan
commented
Feb 10, 2022
There is a problem with exposed scrollController. |
TheCarpetMerchant
commented
Jun 9, 2022
@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). |
nabil6391
commented
Jun 9, 2022
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. |
TheCarpetMerchant
commented
Jun 9, 2022
@nabil6391 Ah of course, that makes sense then. |
saibotma
commented
Jul 7, 2022
Will this be merged eventually @tarobins? |
felipecastrosales
commented
Feb 19, 2023
👁️ |
mrocha98
commented
May 5, 2025
this feature will help me a lot, hope can be merged someday 🙏 |
ibhanu
commented
Aug 6, 2025
can this be merged? |




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 testpass.flutter analyzedoes not report any problems on my PR.