-1

My Route is main -> Screen 1 -> Screen 2-> Tab Screen

Tab Screen Contain Two Tab :

Tab1 , Tab2

How can jump to Screen 1 on using submit button in Tab1 ?

Navigator.of(context) .pushNamedAndRemoveUntil

(TabScreen.routeName,

ModalRoute.withName

(Screen1.routerName));

it's Show me a Black Screen After I navigate to Screen1 and after i back press exit to app

2 Answers2

0

You can use named routes and popUntil:

    Navigator.popUntil(context, (route) => route.settings.name == 'screen_1');
YoBo
  • 2,292
  • 3
  • 9
  • 25
0

The above solutions and the one you tried will require to name the routes first at the top level of your widget tree.

By your explanation I am guessing that on Navigator.pop() from tab screen, you will get the Screen2 page. In this case you can just call Navigator.pop() twice after submit button is pressed.

Sarvesh Dalvi
  • 2,260
  • 2
  • 14
  • 30
  • i call pop() pop() but same result – mustaq saiyed Feb 15 '21 at 09:16
  • In that case you should probably recheck your widget tree. Black screen appears when the is no page left in the stack (basically when you pop out the only page left in the stack). – Sarvesh Dalvi Feb 15 '21 at 11:00
  • Mainpage->FirstPage->SecondPage->ThirdPage->ForthPage Contain 2 Tab Tab1,Tab2 on tab have submit button on submit button i want to move SecondPage but i user above navigation so on click submit i only visible black screen. – mustaq saiyed Feb 15 '21 at 11:11