toNamedRouteWithArgs method

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

Navigates to a named route with specified args.

If a valid BuildContext is provided, this method navigates to the specified route with optional args.

Implementation

void toNamedRouteWithArgs({String? routeName, Map<String,dynamic>? args}) {
  Navigator.pushNamed(
    context,
    routeName!,
    arguments: args,
  );
}