1

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

enter image description here

Uday
  • 1,619
  • 3
  • 23
  • 48

2 Answers2

4

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

Pyth0nGh057
  • 666
  • 1
  • 8
  • 16
1

Use an IconButton as leading widget of your AppBar like,

Scaffold(
  appBar: AppBar(
    leading: IconButton(
      onPressed: () {
        Navigator.of(context).pop();
      },
      icon: Icon(Icons.arrow_back),
      // tooltip: 'Back',  // this cause the overlay 
    ),
  ),
);
Kavin-K
  • 1,948
  • 3
  • 17
  • 48