无法定义在列表视图生成器中按下图标按钮时将打开的web链接,该生成器已在expantionbar中



(问题1(我不知道如何传递3个网络链接(google.com、yahoo.com、youtube.com(,当主题1中的3个相应图标在代码中按下时,该链接将打开:https://github.com/sandeepnarula999/FlutterProjects/blob/main/ListViewUnderExpansionTile如果你能解决我的问题,请尝试分享完整的代码。。正如我在上面分享的完整代码。。。请照做不要只分享如何做的步骤,因为当我尝试时,这些步骤可能会导致错误

(问题2(根据下面的图片建议,当我试图在abve代码链接中将代码从第7行更改为第10行时,我会出现错误。。你能在图像中用下面的方法获得零误差吗

解决方案:在Row小部件中添加三个Flexible小部件;(

if (root.children.isEmpty) {
return ListTile(
title: Text(root.title),
subtitle: root.subtitle == null ? null : Text(root.subtitle!),
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: [
Flexible(
child: IconButton(
onPressed: () {},
icon: const Icon(Icons.auto_stories),
iconSize: 30,
tooltip: 'Documents',
),flex: 1,
),
Flexible(
child: IconButton(
onPressed: () {},
icon: const Icon(Icons.video_collection_rounded),
iconSize: 30,
tooltip: 'Videos',
),
flex: 1,
),
Flexible(
child: IconButton(
onPressed: () {},
icon: const Icon(Icons.favorite),
iconSize: 20,
tooltip: 'Shortlist',
),flex: 1,
),
],
),
);
}

在此处输入图像描述

相关内容

最新更新