flutter - 颤振:如何创建带有链接和可点击图标的文本小部件
问题描述
如何在颤动中创建下面的图片。我尝试使用 Richtext 和小部件跨度(可单击图标),但在小部件跨度方面出现错误.. 是否有另一种方法可以在没有小部件跨度的情况下使用不同的布局
这是我的代码
Expanded(
child: RichText(
text: new TextSpan(
children: [
TextSpan(
text:
'Email me career-related updates and job opportunities. company ',
style: TextStyle(
color: Palette.DARK_BLUE, fontSize: 16.0),
),
TextSpan(
text: 'privacy policy',
style: TextStyle(
color: Palette.DARK_BLUE,
fontSize: 16.0,
decoration: TextDecoration.underline),
recognizer: TapGestureRecognizer()
..onTap = () {
launch('https://www.google.com');
},
),
TextSpan(
text: ' and ',
style: TextStyle(
color: Palette.DARK_BLUE, fontSize: 16.0),
),
TextSpan(
text: 'terms of use ',
style: TextStyle(
color: Palette.DARK_BLUE,
fontSize: 16.0,
decoration: TextDecoration.underline),
recognizer: TapGestureRecognizer()
..onTap = () {
launch('https://www.google.com/');
},
),
WidgetSpan(
child: Container(
child: Icon(
Icons.info_outline,
color: Colors.red,
),
),
)
],
),
),
),
解决方案
推荐阅读
- git - Visual Studio、TFS 和 Git LFS:如何设置远程存储?
- javascript - BabelJS 错误“不知道如何把这个值变成一个节点”
- tensorflow - Bag of words 中使用的单词以及 keras tokenizer 中的频率
- msdeploy - 带有 runcommand 的 msdeploy.exe:执行命令时出现问题
- c++ - 在声明中指定向量的大小与使用保留
- python - 如何在编辑后验证 pydantic 对象
- java - 我的 JFrame 有一个错误“无法实例化 JFrame 类型”,并且没有针对产品进行研究
- python - Group by 模糊字符串匹配与fuzzywuzzy 和groupby
- c# - 错误,SMTP 服务器需要安全连接或客户端未通过身份验证。服务器响应为:5.7.57 SMTP;
- amazon-web-services - 在 AWS CodeBuild 上预置自定义 Docker 映像需要很长时间