Flutter Chapter 6 of 16
Navigation and Routing
Move between screens, pass data back and forth, and set up URL-based routing with go_router.
Almost every app has more than one screen. This chapter covers moving between them, from the simple built-in navigator to URL-based routing for larger apps.
Lessons in this chapter
- Navigation in Flutter: Navigator.push and popLearn screen navigation in Flutter with Navigator.push, pop, pushReplacement and pushAndRemoveUntil, and how the navigation stack works.
- Passing Data Between Screens in FlutterSend data to a new screen through its constructor and return a result with Navigator.pop in Flutter, with typed results and examples.
- Routing with go_router in FlutterSet up URL-based navigation in Flutter with go_router: routes, path and query parameters, redirects for login, and nested navigation.
- Navigation Patterns in Flutter: Back Handling and Deep LinksHandle the back button with PopScope, confirm before leaving a form, set up deep links, and choose a navigation structure for your app.