toReplaceNamed function
Replace the current route with a named route, optionally passing arguments.
Example:
toReplaceNamed('/newPage', arguments: {'data': data});
Implementation
void toReplaceNamed(String routeName, {Map<String, dynamic>? arguments}) {
Navigator.of(Utils.navigatorKey.currentContext!)
.pushReplacementNamed(routeName, arguments: arguments);
}