Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to change what the back button does in dart

How can I change the function of the back button in dart flutter
enter image description here

I really didn’t try anything because tbh, i didn’t find what to try

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You need simply to override the leading property in the AppBar with a new IconButton, then set your specific method:

AppBar(
 leading: IconButton(
  onPressed: () {
   print("clicked");
  },
  icon: Icon(Icons.abc),
  ),
 ),
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading