[Feature] : Appinio Swiper preserve widget states when moving from background to foreground #267
Labels
Appinio swiper
This label is used to indicate that this issue belongs to Appinio swiper plugin
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
The text was updated successfully, but these errors were encountered: