replaceWithNamedRouteWithArgs method
Replaces the current route with a named route and optional args.
If a valid BuildContext is provided, this method replaces the current route with the specified named route and passes optional route-specific args.
Implementation
void replaceWithNamedRouteWithArgs({String? routeName, Map<String,dynamic>? args}) {
Navigator.pushReplacementNamed(
context,
routeName!,
arguments: args,
);
}