Navigate to a new screen and back

Pass arguments to a named route

Navigate with named routes

Cookbook

Navigation

Navigate with named routes

1. Create two screens

2. Define the routes

3. Navigate to the second screen

4. Return to the first screen

Interactive example

Note:
  Named routes are no longer recommended for most
  applications. For more information, see
  Limitations in the navigation overview page.

In the Navigate to a new screen and back recipe,
you learned how to navigate to a new screen by creating a new route and
pushing it to the Navigator.

However, if you need to navigate to the same screen in many parts
of your app, this approach can result in code duplication.
The solution is to define a named route,
and use the named route for navigation.