This recipe uses the Navigator to navigate to a new route.

The next few sections show how to navigate between two routes,
using these steps:

Create two routes.

Navigate to the second route using Navigator.push().

Return to the first route using Navigator.pop().

1. Create two routes

First, create two routes to work with. Since this is a basic example,
each route contains only a single button. Tapping the button on the
first route navigates to the second route. Tapping the button on the
second route returns to the first route.

First, set up the visual structure:

2. Navigate to the second route using Navigator.push()

Navigator.push()
method. The

MaterialPageRoute,
which is useful because it transitions to the
new route using a platform-specific animation.