toNamed function

void toNamed(
  1. String routeName, {
  2. Map<String, dynamic>? arguments,
})

Navigate to a named route with optional arguments.

Example:

toNamed('/details', arguments: {'id': 1});

Implementation

void toNamed(String routeName, {Map<String, dynamic>? arguments}) {
  Navigator.of(Utils.navigatorKey.currentContext!)
      .pushNamed(routeName, arguments: arguments);
}