removeUntilFirstAndPushReplacementWidget method

void removeUntilFirstAndPushReplacementWidget(
  1. Widget widget
)

Removes all routes and pushes the given widget as the new root route.

This effectively resets the navigation stack to contain only the given widget.

Implementation

void removeUntilFirstAndPushReplacementWidget(Widget widget)
{
  pushAndRemoveUntil(NavUtil.route(widget), (route) => false);
  // popUntilFirst();
  // pushReplacementWidget(widget);
}