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.
//========================================================
new ListTile(
title: new RaisedButton(
child: new Text("POP until"),
onPressed: () {
var route = new MaterialPageRoute(
builder: (BuildContext context) =>
new NextPage3(value:"hi there from 3"),
);
//Navigator.pop(context, ModalRoute.withName('/'));
Navigator.popUntil(context,ModalRoute.withName('/'));
},
),
),
//========================================================
replace .pop with .popUntil, actually works very elegantly.