FlowinKeepAlivePage constructor

const FlowinKeepAlivePage({
  1. required Widget child,
  2. Key? key,
})

Keeps a lazily-built page alive when its scroller would otherwise dispose it.

PageView and TabBarView build pages on demand and dispose them once they scroll far enough away, which discards their state — scroll positions, text in progress, expanded sections. Wrapping a page in this pins it via AutomaticKeepAliveClientMixin so returning to it finds it as it was left.

Give it a PageStorageKey when the scroller recycles positions, so the framework can match the kept state back to the right page.

Implementation

const FlowinKeepAlivePage({required this.child, super.key});