Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tooltip on Drawer

I want to change the "Open navigation menu" default tooltip for the Drawer option but I don't know where I need to go.

I'm making an app and I want to change the tooltip, it's invisible in the code so I don't know how to change it

like image 335
Aymeric Le Feyer Avatar asked Mar 08 '26 14:03

Aymeric Le Feyer


1 Answers

You can change the tooltip by customizing it through appBar, as below:

return Scaffold(
      appBar: AppBar(
        title: Text('test'),
        leading: Builder(
          builder: (BuildContext context) {
            return IconButton(
              icon: Icon(Icons.menu),
              onPressed: () {
                Scaffold.of(context).openDrawer();
              },
              tooltip: 'Something else',
            );
          },
        ),
      ),
      drawer: Drawer(
        child: ListView(
         // whatever you want to display when nav drawer opens

Now when you long press on nav drawer icon, you'll see 'Something else' as the tooltip.

enter image description here

Hope this answers your question.

like image 98
Darshan Avatar answered Mar 10 '26 04:03

Darshan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!