pushReplacement function
Implementation
void pushReplacement(BuildContext context, Widget widget,
{Route? route, bool? adaptive}) {
if (!isNavMounted(context)) {
throw "Navigator is unmounted";
}
Navigator.pushReplacement(
context, route ?? router(context, widget, adaptive: adaptive));
}