I'm developing a social app with flutterflow.
Is there a way to keep and restore the pageView state itself and its children data when user navigates to another app page? My use case is a feed page based on pageView that uses infinite scrolling.
The user swiped down 20 times, clicked on "View profile" button and then clicked on "Return" button. He/she expects to be in the same swiping position and see the last post again.
There is no built in way to preserve the list of read posts and the pageView index and infinite scrolling offset.
Any idea how this problem may be solved?
I tried saving the pageView widget index in app state and use Jump-to-page action when user returns. It does not work well with the infinite scrolling. Say the user swiped 20 tomes and the scrolling count is 5, it will not go to the 20th page but to the 8th page.
In a flutter app, one can preserve page state with AutomaticKeepAliveClientMixin as explained here https://www.youtube.com/watch?v=aw8OG_zfuxY
or here https://medium.com/manabie/flutter-simple-cheatsheet-4370a68f98b3
but in flutterflow we do not have control over the generated flutter code so we cannot use it.
Same with restoration method of https://api.flutter.dev/flutter/widgets/RestorationMixin-mixin.html
Maybe there's a way to write flutterflow custom actions to save and restore the state and data of PagedListView? as it is part of infinite_scroll_pagination package used by FF. The state is in
infinite_scroll_pagination-4.0.0/lib/src/model/paging_state.dart
FF uses similar technique for TabBar where it allows "Keep Tab State Alive" option for all tabs (using KeepAliveWidgetWrapper) but there's no feature like that for each page.
I searched everywhere but couldn't find any solution using flutterflow, even that this is such a common navigation scenario.
Any ideas will be welcome