How to Keep the NavigationBar Selected Tab in Sync with the Current Route Using StatefulShellRoute in go_router
Drive NavigationBar.selectedIndex from StatefulNavigationShell.currentIndex, never from a setState field or a copy made in initState. Measured on Flutter 3.44.8 and go_router 18.0.2: which patterns drift on deep links, context.go and cross-branch pushes, why location-based indexes lie, and how to react to tab changes with didUpdateWidget.