pushNamed<T> method
Equals to Navigator.of(context).push()
Just give it the routeName
you want to push
Example
context.pushNamed('/counterPage');
Implementation
Future<T?> pushNamed<T>(String routeName, {Object? arguments}) async =>
Navigator.of(this).pushNamed<T>(
routeName,
arguments: arguments,
);