it does matter the view number you've got opened and you want to get back to the main view without reloading or refreshing data, and if you do not use name routes you can use
Navigator.of(context).popUntil((route) => route.isFirst);
if you are using Provider to have data stored with the
Navigator.of(context).popUntil((route) => route.isFirst);
you won't lose any data when you get to the main view
Comments
Post a Comment