-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
ListView inside PageView should remember its scroll position when off-screen #8101
Comments
Yes, we need to fix this. The current thinking is to create a tree of scroll controllers somehow so that if you're in the middle of a vertical drag when you switch tabs, you'll be able to continue to drag vertically and the scroll will affect the new tab's contents. /cc @Hixie |
@abarth Thanks for the reply - just to be sure, in case my original question was poorly worded: What I meant was that if I (1) scroll down in Tab 1, then (2) swipe to Tab 2, then (3) swipe back to Tab 1, the Sorry, if that was what you meant anyway - in that case I just misunderstood your reply! |
Ah, sorry. I misunderstood what you were asking for. I've updated the the bug title. Thanks! |
Perfect, thanks! |
Yeah we should probably restore the page storage logic. |
Bummer. I had code for that in #8074 but I don't see how to dig it out of the history of that PR. |
Might still be in your reflog on your workstation? |
@lukef can you help us understand the priority of this bug? It's not a hard fix, just not currently viewed as high severity. |
Hi, I have a similar question. My Pagelayout looks something like this:
Now when I scroll down my ListView and then changed pages and come back exactly the thing @DavidMihola mentioned happens. It doesn't remember the index it was at. Is there any variable / reference I can pass down to the ListView, so it will remember where it was? I don't know, how you PR works internally, so I am very thankful, for any directions. |
This helped me: https://stackoverflow.com/questions/46042537/multi-tab-page-view-in-flutter/46046510#46046510.
|
Solution @Josemboa offered works great (thanks for that) but causes lots of lag if especially when you have lots of items in the list. I know this is an old discussion so perhaps there's a better way of doing it nowadays? |
Waiting as well! @Luppakorva @eseidelGoogle |
Any finds? @Luppakorva |
I would create the |
Tengo un problema, en el body de mi scaffold género un Listview que llama a dos Swiper, y puedo hacer scroll sin problemas, el problema surge cuando agrego más, cuando hago scroll para volver al inicio de la página, este no llega nunca, se repiten los swiper..ayuda por favor |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
This is just a question: In, for example, the "Stocks" example app, would it be possible to keep the scroll position from resetting every time I swipe left or right between the children of the
TabBarView
?The text was updated successfully, but these errors were encountered: