toReplace function
Replace the current page with the provided page widget, optionally passing arguments.
Example:
toReplace(MyReplacementPage(), arguments: {'refresh': true});
Implementation
void toReplace(Widget page, {Map<String, dynamic>? arguments}) {
Navigator.of(Utils.navigatorKey.currentContext!).pushReplacement(
MaterialPageRoute(builder: (context) => page),
result: arguments,
);
}