Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to Navigator.pop(context) current screen from other StatefulWidgetl widget

i need to leave screen to previous one from difference current screen

 StatefulWidget 1 {....
  void leaveStatefulWidget3(){
  Navigator.pop(context);
  }
 ....} 

 StatefulWidget 2 {....}

 StatefulWidget 3 {....} // the current one (where i am exists now )

well .. now i am navigated from 1 to 2 to 3.

now i need to leave or Navigator.pop(context) the stateFull 3 which is the current (where i am exists now ) from stateFull 1

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

NOTE : i am completely have the ability to access my leaveStatefulWidget3() method from StatefulWidget 3 but don’t know how to specify the route to use Navigator.pop(context) for stateFull 3 .

when i use Navigator.pop(context) direct from stateFull 1 it do leave the stateFull 1 .

>Solution :

just use Navigator.pop(context) twice

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading