int count = 0;
Navigator.popUntil(context, (route) {
return count++ == 2;
});
Get tutorials, Flutter news and other exclusive content delivered to your inbox. Join 1000+ growth-oriented Flutter developers subscribed to the newsletter