pushReplacement function

void pushReplacement(
  1. BuildContext context,
  2. Widget widget, {
  3. Route? route,
  4. bool? adaptive,
})

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));
}