【发布时间】:2020-10-30 16:01:55
【问题描述】:
我正在尝试在 Flutter 中创建下面的图片。如您所见,我需要一个链接和一个图像图标。但是,我在控制台中收到“范围”错误。
这是我的代码的 sn-p
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Image.asset(
"assets/images/checkbox-check.png",
),
Expanded(
child: Container(
child: Wrap(
children: [
RichText(
text: new TextSpan(
children: [
TextSpan(
text: 'Email opportunities. ',
style: TextStyle(
color: Palette.DARK_BLUE, fontSize: 16.0),
),
TextSpan(
text: 'privacy policy',
style: TextStyle(
color: Palette.DARK_BLUE,
decoration: TextDecoration.underline),
recognizer: TapGestureRecognizer()
..onTap = () {
launch();
},
),
TextSpan(
text: ' and ',
),
TextSpan(
text: 'terms of use',
style: TextStyle(
decoration: TextDecoration.underline),
recognizer: TapGestureRecognizer()
..onTap = () {
launch();
},
),
WidgetSpan(
child: Icon(
Icons.info_outline,
color: Colors.red,
),
)
],
),
),
],
),
),
)
],
);
} }
还有其他方法可以创建我的用户界面吗?我没有收到错误屏幕,但我在控制台中看到了错误。我在小部件树中有一个包装,但认为我不需要它。但如果我删除它,同样的问题也不会少。
【问题讨论】:
标签: flutter