美文网首页
Flutter Text.rich富文本

Flutter Text.rich富文本

作者: 倪大头 | 来源:发表于2019-11-13 10:26 被阅读0次
child: Text.rich(
   TextSpan(
      text: '在线咨询',
      style: TextStyle(color: Colors.red, fontSize: 13),
      children: <TextSpan>[
         TextSpan(
            text: ',等你消息',
            style:TextStyle(color: Colors.black54),
            recognizer: TapGestureRecognizer()..onTap=() {
               print('你好吗');
            },
         ),
      ],
   ),
),

每一段TextSpan都可以设置不同的效果和点击事件

相关文章

网友评论

      本文标题:Flutter Text.rich富文本

      本文链接:https://www.haomeiwen.com/subject/qkchictx.html