Ganesh
Ganesh

Reputation: 1

Flutter Drawer Navigation

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?

Upvotes: -1

Views: 347

Answers (1)

Abdallah Abdel Aziz
Abdallah Abdel Aziz

Reputation: 676

Just use the standard navigation:

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

Upvotes: 0

Related Questions