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