Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter Tooltip on all widgets

Tags:

flutter

dart

Is there a way to set a tooltip on a Text widget:

new Text(
    "Some content",
    tooltip: "Displays a message to you"
  )

This does not work. However it does work, as mentioned here, on things like the FloatingActionButton:

new FloatingActionButton(
    onPressed: action,
    tooltip: "Action",
    child: new Icon(Icons.add),
  )

I understand that the Text class does simply not have tooltip implemented. I want to know if there is a way to do it anyway.

like image 965
creativecreatorormaybenot Avatar asked Apr 25 '18 13:04

creativecreatorormaybenot


1 Answers

You can wrap your text into a Tooltip widget.

new Tooltip(message: "Hello World", child: new Text("foo"));
like image 176
Rémi Rousselet Avatar answered Sep 19 '22 16:09

Rémi Rousselet