Summary
In this chapter, we explored the concept of screens within an app and saw how to add navigation between them. First, we learned about the Navigator
widget, the main player when it comes to navigation in Flutter.
We also saw another important piece of navigation, Route
, and how to define it for use in our applications. We learned how to use named routes and how to pass arguments to the named route widgets.
We also explored the new Navigator 2.0 approach to get a feel for how this declarative approach to screen management contrasts with the Navigator 1.0 imperative approach. As part of this, we delved into the go_router
package to see one of the recommended ways to use Navigator 2.0.
Finally, we briefly explored app state management and some of the common approaches. This is a rich area that you should explore when you become more confident with Dart and Flutter.
In the next chapter, we will start to look at another part of the framework that allows Flutter developers...