offAll static method

void offAll(
  1. Widget page, {
  2. FlowsBinding? binding,
})

Remove all routes until the first one

Implementation

static void offAll(Widget page, {FlowsBinding? binding}) {
  if (binding != null) {
    binding.dependencies();
  }
  navigator?.pushAndRemoveUntil(
    MaterialPageRoute(builder: (_) => page),
    (route) => false,
  );
}