Open MiniSuperDev opened 2 years ago
after append the item on top of the list u can call scrollController.jumpTo(index: lastPosition);
before refreshing the UI.
works for me
good question! if you have some way to realization it, pls tell me the way.
after append the item on top of the list u can call
scrollController.jumpTo(index: lastPosition);
before refreshing the UI.works for me
This works, but stops an ongoing animation, e.g. when user is scrolling
Hi, I had created bidirectional lazy load list (load next when reached last item, and load previous when reached first item, like discord chat when search a message and you select it, it loads messages around the that message, so the user can load previous and next messages based on the scroll) Like the like flutter docs said https://dartpad.dev/?id=c8790d62affcda2ad56325f0588d4810 https://github.com/flutter/flutter/blob/5464c5bac742001448fe4fc0597be939379f88ea/packages/flutter/lib/src/widgets/scroll_view.dart#L502-L513 https://github.com/flutter/flutter/issues/21541#issuecomment-629121578
But I also need the scroll to index behavior, so how can I implement this behavior with scrollable_positioned_list?
Since I can't use 2
ScrollablePositionedList
inside aCustomScrollView
and use a centerKey on the second list, I'm wondering if can I add items to the top while preserving the scroll, or maybe you know of another way to achieve this behavior.thank you