As we have seen before, this is not the most practical way to use Navigator in our applications: we have many things to manage that could be avoided.
The typical way to use it is through the app widgets. They offer some properties and methods to include navigation in the application:
- builder: The builder property allows us to add an alternative path to the Navigator, which is added by the WidgetsApp.
- home: Lets us specify the widget equivalent to the first route in the app (normally '/').
- initialRoute: Allows us to change the initial route of the app (defaults to '/').
- navigatorKey and navigatorObserver: Allows us to specify corresponding values to the built Navigator widget.
- onGenerateRoute: Creates widgets based on the ...