pushNamedRoute<T extends Object?> method

Future<T?> pushNamedRoute<T extends Object?>(
  1. String routeName, {
  2. Object? args,
})

Pushes a named route onto the navigator stack.

The routeName parameter specifies the name of the route to push. The args parameter can be used to pass arguments to the pushed route.

Returns a Future that resolves to the value returned by the pushed route.

Implementation

Future<T?> pushNamedRoute<T extends Object?>(String routeName,
    {Object? args}) {
  return Navigator.of(this).pushNamed<T>(
    routeName,
    arguments: args,
  );
}