Flutter Drawer Navigation

330 Views Asked by At

I have a list of Screens in a custom drawer.

Screen 1, Screen 2, Screen 3

What is the proper way of navigating from Screen 1 to Screen 2 on push of a button. Currently, I am losing the hamburger (the drawer button) option when I push or push replace.

The code I have was not written by me and I do not have access to the person who wrote the code.

Any thoughts?

1

There are 1 best solutions below

2
On

Just use the standard navigation:

TextButton(
  onPressed: (){
    Navigator.push(context, MaterialPageRoute(builder: (context) => Screen2()));
  }
  child: 
    //child goes here
)