Understanding the Navigator widget
Mobile applications will almost always contain more than one screen. If you are an Android or iOS developer, you probably know about the Activity
or ViewController
classes, which represent screens on those platforms.
An important class for navigation between screens in Flutter is the Navigator
widget, which is responsible for managing screen changes while maintaining a history of screens so that the user can move back through the screens (if the app chooses to allow it).
A new screen in Flutter is just a new widget that is effectively placed on top of the existing widgets. This is managed through the concept of routes, which define the possible navigable routes a user can follow through the app. Unsurprisingly, there is a class named Route
that is a helper for working on the navigation workflow.
The main classes in the navigation layer are as follows:
Navigator
: The route managerOverlay
:Navigator
uses this to specify the appearances...