-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
[Bug report] jumpTo is too slow #79
Comments
No, unless the height of your item is fixed. observerController.jumpTo(index: 450, isFixedHeight: true); Releated issue: #5 |
My app is chat app. Of course, each item is different in height. |
In the _handleScrollToIndex function, nextPageOffsetRectified is looking for it one by one, is there a way to go at once? |
Only when the target item is rendered can this package calculate the corresponding offset. Without scrolling, it is impossible for the ListView to render the item with index 450 unless the |
There's something library super_sliver_list, and I don't know if it's jumpTo after item rendering, but it's jumpToItem directly. But I need ChatObserverClampingScrollPhysics with physics like scrollview_observer. Because chat app need to that function what fix scroll position when other person sends me a chat message. |
Don’t worry, var scrollViewPhysics =
physics.applyTo(ChatObserverClampingScrollPhysics(
observer: chatObserver,
));
+ Widget resultWidget = SuperListView.builder(
physics: chatObserver.isShrinkWrap
? const NeverScrollableScrollPhysics()
: scrollViewPhysics,
shrinkWrap: chatObserver.isShrinkWrap,
reverse: true,
controller: scrollController,
itemBuilder: ((context, index) {
return ...;
}),
...,
);
resultWidget = ListViewObserver(
controller: observerController,
child: resultWidget,
+ customTargetRenderSliverType: (renderObj) {
+ return renderObj.runtimeType.toString() == 'RenderSuperSliverList';
+ },
); |
Oh, my God. You're a genius. Thank you |
Version
1.19.1
Platforms
Android
Device Model
Galaxy s9+
flutter info
How to reproduce?
observerController.jumpTo(index: 450);
The jumpTo function is too slow. It's like animateTo. In my case, My app has the ability to search for messages. Sometimes I have to go directly from index 0 to 1000. But the scrolling is too slow to get to the wanted index.
I want it to scroll to position immediately, such as scrollable_positioned_list or super_sliver_list. It's better to have alignment. Is it possible?
Thank you.
Logs
No response
Example code (optional)
Contact
No response
The text was updated successfully, but these errors were encountered: