I am recursively adding routes to the navigator. There could be 20 views or more. Pop works as advertised, but I would like to pop to index 1 and remove all push history.
Here Dashboard() is the screen name. So this will pop out all the screens and goto Dashboard() screen.
Navigator.of(context).pushAndRemoveUntil( MaterialPageRoute(builder: (c) => Dashboard()), (route) => false)