加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

dart – 所有小部件上的Flutter Tooltip

发布时间:2020-12-14 14:50:45 所属栏目:百科 来源:网络整理
导读:有没有办法在Text小部件上设置工具提示: new Text( "Some content",tooltip: "Displays a message to you" ) 这不起作用.然而,对于像FloatingActionButton这样的东西,它确实有效,如mentioned here: new FloatingActionButton( onPressed: action,tooltip:
有没有办法在Text小部件上设置工具提示:

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

这不起作用.然而,对于像FloatingActionButton这样的东西,它确实有效,如mentioned here:

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

我知道Text类没有实现工具提示.无论如何,我想知道是否有办法做到这一点.

解决方法

您可以将文本包装到 Tooltip小部件中.

new Tooltip(message: "Hello World",child: new Text("foo"));

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读