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

[Feature] : Appinio Swiper preserve widget states when moving from background to foreground #267

Open
JonathanKohlhas opened this issue Apr 10, 2024 · 1 comment
Assignees
Labels
Appinio swiper This label is used to indicate that this issue belongs to Appinio swiper plugin

Comments

@JonathanKohlhas
Copy link

Plugin name
Appinio Swiper

Is your feature request related to a problem? Please describe.
When Statefull Widgets move from being in the background of the swiper to being in the foreground of the swiper, they are rebuild without preserving their state. Local keys cannot be used because the foreground and background cards don't have the same parent in the widget tree. At the same time Global Keys cannot be used, because of how the background is constructed by repeating the same widget, as this leads to error because of multiple widgets with the same global key.

Describe the solution you'd like
The state of the widgets should be preserved and preferably Global Keys would also be usable on card widgets, maybe a background card could be provided to the swiper that is used for every background card after the second one ? this would prevent problems with using global keys.

Additional context
In my specific case the reason why recreation of the widget state is a problem is because the cards contain looping videos that restart with a noticable delay when cards move to the foreground a card is swiped away

@julian-bruening
Copy link

I have exactly the same use case. The noticeable delay in my case only is a flicker, albeit an annoying one, because I started to initialize the video outside the AppinioSwiper to improve the performance. But having the behaviour like described by @JonathanKohlhas would make the code cleaner and remove the flicker altogether.

Thanks in advance!

@khanmujeeb687 khanmujeeb687 added the Appinio swiper This label is used to indicate that this issue belongs to Appinio swiper plugin label Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Appinio swiper This label is used to indicate that this issue belongs to Appinio swiper plugin
Projects
None yet
Development

No branches or pull requests

3 participants