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

Time:07-21

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

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 .

CodePudding user response:

just use Navigator.pop(context) twice

  • Related