Flutter tab shell keeps each page alive to avoid redundant work on tab switches
A common problem in Flutter bottom navigation is that replacing a route on every tap reruns initState, repeating network requests, polling and scroll resets even when nothing has changed. The GwinG team fixed this by hosting all four main tabs in a single route and switching the visible child with an IndexedStack instead. Pages are built lazily on first visit, except the Friends tab, which loads at startup because users open it most often. A shared notifier drives every navigation entry point, including taps, swipes, shortcuts and deep links, so the highlight, visible page and saved tab stay in sync. Tab changes use a brief fade, which is disabled for users who prefer reduced motion.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in