2. Create a widget that extracts the arguments

Next, create a widget that extracts and displays the
title and message from the ScreenArguments.
To access the ScreenArguments,
use the ModalRoute.of() method.
This method returns the current route with the arguments.

3. Register the widget in the routes table

Next, add an entry to the routes provided to the MaterialApp widget. The
routes define which widget should be created based on the name of the route.

4. Navigate to the widget

Navigator.pushNamed().
Provide the arguments to the route via the

Alternatively, extract the arguments using onGenerateRoute

Instead of extracting the arguments directly inside the widget, you can also
extract the arguments inside an onGenerateRoute()
function and pass them to a widget.

The onGenerateRoute() function creates the correct route based on the given
RouteSettings.

Interactive example