What is the difference between Navigator 1.0 and Navigator 2.0?
Navigator 1.0 is an imperative stack API (push/pop). Navigator 2.0 is a declarative API driven by a Router ...
20 questions
Navigator 1 & 2, go_router, deep linking
Navigator 1.0 is an imperative stack API (push/pop). Navigator 2.0 is a declarative API driven by a Router ...
Define a GoRouter with a list of GoRoutes. Replace MaterialApp with MaterialApp.router. Navigate with conte...
Deep linking requires configuring platform schemes/domains (AndroidManifest, Info.plist), handling incoming...
Nested navigation means each tab or section has its own navigation stack. In go_router use ShellRoute. With...
Data can be passed via constructor arguments (Navigator 1.0), route path/query parameters, route arguments ...
Named routes map string paths to widget builders in MaterialApp.routes. They reduce duplication in large ap...
In go_router, use the redirect callback — check auth state and return '/login' if unauthenticated. Use refr...
Use PopScope (Flutter 3.12+, replaces WillPopScope) to intercept back navigation. Set canPop: false and han...
Override the buildTransitions method in a custom PageRoute, or use PageTransitionsTheme for app-wide transi...
Navigator.push returns a Future. Call Navigator.pop(context, result) on the child route to complete the Fut...
RouteObserver is a NavigatorObserver that widgets can subscribe to. It notifies them when they become activ...
Dialogs interrupt the user with important decisions or alerts. Bottom sheets show contextual actions or add...
go_router on Flutter Web automatically syncs the browser URL with navigation state and handles browser back...
Hero animates a widget from its position in the source route to its position in the destination route. Both...
push adds a route to the stack. pushReplacement replaces the current route (back goes to previous). pushAnd...
Set theme.pageTransitionsTheme in MaterialApp's ThemeData to apply custom transitions for all routes on spe...
Flutter offers BottomNavigationBar/NavigationBar (mobile bottom), NavigationRail (tablet side), TabBar (top...
auto_route generates strongly-typed route classes with code generation, eliminating string-based navigation...
Flutter's Overlay widget is a stack of OverlayEntries that sits above all routes. Insert an OverlayEntry to...
Use a mock NavigatorObserver in widget tests to verify navigation calls. For go_router, use GoRouter with a...