Home > database >  How to change what the back button does in dart
How to change what the back button does in dart

Time:01-19

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

CodePudding user response:

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),
  ),
 ),
  • Related