generator method Null safety

Route? generator(
  1. RouteSettings routeSettings

Route generation method. This function can be used as a way to create routes on-the-fly if any defined handler is found. It can also be used with the MaterialApp.onGenerateRoute property as callback to create routes that can be used with the Navigator class.


Route<dynamic>? generator(RouteSettings routeSettings) {
  RouteMatch match =
      matchRoute(null,, routeSettings: routeSettings);
  return match.route;