0

I am Currently using the scaffold, and inside that, I have a tab bar, and in that tab bar, I have two tabs, product one and product two, and I have a button inside the page one page, and when I click on that button, it will redirect me to the Product three page, but I don't want to change the app bar, i.e., I want to only render the page three content over the page one, and if I press the back button, then the page one should again occur via page three. I want the solution for this rendering or navigation thing.

  • 1
    add codes that you have tried to implement. it's better than saying, in that widget there is that and so on. – Amir Jun 23 '23 at 11:40

1 Answers1

0

you can use bloc package to change state of your widget

 Scaffold(
   appBar:AppBar(), 
   body:
    BlocBuilder<MyPagebloc, MyPageState>( 
       builder: (context, state) {
        if(state.page1) 
          return Page1();
       else 
          return Page3();
       }
    )

and to change state

context.read<MyPagebloc>().add(someEvent);
Ahmed_Amr
  • 93
  • 4
  • but i am having a button inside the pageone and when the button click the page3 will appear and when i am pressing the back button from the page3 it should go again page1 – santosh patro Jun 23 '23 at 13:04