Search code examples
flutterflutter-layoutscaffold

Long hold on back arrow of action bar in flutter shows a "Back" toast, how to remove that?


How to remove the toast displayed on the Action bar in a flutter on Long hold on back arrow.

enter image description here


Solution

  • In your appBar you can replace the leading parameter by what you want.

    Try replacing it with :

    AppBar(
       leading: IconButton(
          icon: Icon(Icons.arrow_back),
          onPressed: () {
             Navigator.of(context).pop();
          },
       ),
    ),
    

    It should remove the tooltip. If you want to customize it, see the tooltip parameter of IconButton