Understanding the Navigator widget
Mobile applications will often contain more than one screen. If you are an Android or iOS developer, you probably know about Activity
or ViewController
classes that 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 screens (if the app allows it).
A new screen in Flutter is just a new widget that is effectively placed on top of another. This is managed through the concept of routes, which define the possible navigable routes a user can follow through the app. As you may already have guessed, the Route
class is a helper for Flutter to work on the navigation workflow.
The main classes in the navigation layer are as follows:
Navigator
: TheRoute
manager.Overlay
:Navigator
uses this to specify the appearances of the routes.Route...