First of all, I'm not setting my routs in the MaterialApp like this
new MaterialApp(
home: new Screen1(),
routes: <String, WidgetBuilder> {
'/screen1': (BuildContext context) => new Screen1(),
'/screen2' : (BuildContext context) => new Screen2(),
'/screen3' : (BuildContext context) => new Screen3(),
'/screen4' : (BuildContext context) => new Screen4()
},
)
Instead, I'm routing from different places in my app by pushing new rout like this:
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
Screen3(someInputData)));
How I can pop screens from the current one into screen number 2 for example?