Skip to content
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

Scroll to index stops working for AutomaticKeepAlive widgets #106

Open
PT10 opened this issue Jul 15, 2023 · 4 comments
Open

Scroll to index stops working for AutomaticKeepAlive widgets #106

PT10 opened this issue Jul 15, 2023 · 4 comments

Comments

@PT10
Copy link

PT10 commented Jul 15, 2023

Hi,

This is indeed a great library and working quite well until we have widgets which we want to keep alive throughout. In our case the inner widgets (of the ListView) are quite heavy. So want to load them only first time and then preserve their state forever for a smooth scrolling experience.

What we have observed is that if the child element inside the ListView uses AutomaticKeepAliveClientMixin with wantKeepAlive set to true, the scroll to index stops working if you go back and forth few times. I think it has something to do with the tagMap you maintain internally. Please let me know if there is any solution to this problem.

Thanks
Prasad

@PT10 PT10 changed the title Scroll stops working for AutomaticKeepAlive widgets Scroll to index stops working for AutomaticKeepAlive widgets Jul 15, 2023
@jerrywell
Copy link
Member

Hi, glad to hear you love it : D
for this issue, may you provide the simple code example for debug?

@vanlooverenkoen
Copy link

I had something similar. I had a Sliver, and the Sliver.builder had this setup

addAutomaticKeepAlives: false

Going form 1 to 10 (index) was working just fine
But going back resulted in a rebuild of the whole page.

The addAutomaticKeepAlives: false was not required in my case anymore so I was able to remove it and everything worked fine.

@KojackNguyen
Copy link

KojackNguyen commented Jun 24, 2024

@PT10
hi sir, did you fixed this issue ?
Can you provide simple source code have this issue ? Thanks

@linhtn1nws
Copy link

Any update ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants