如何降低颤动中膨胀元素元素之间的空间?
这是我的代码:
ExpansionPanel(
headerBuilder: (BuildContext context, bool isExpanded) {
return SizedBox(
//height: 20,
child: ListTile(
title: Text("Files (2)"),
leading: Icon(Icons.folder_outlined),
minLeadingWidth : 4,
contentPadding: EdgeInsets.symmetric(vertical: 0.0, horizontal: 16.0),
),
);
},
body: Column(
children: [
ListTile(
title: Text("File_0"),
leading: Icon(Icons.insert_drive_file),
minLeadingWidth : 4,
contentPadding: EdgeInsets.symmetric(vertical: 0.0, horizontal: 16.0),
),
ListTile(
title: Text("File_1"),
leading: Icon(Icons.insert_drive_file),
minLeadingWidth : 4,
contentPadding: EdgeInsets.symmetric(vertical: 0.0, horizontal: 16.0),
)
],
),
isExpanded: items[0].isExpanded,
),
这是结果:
您看到文件夹和文件之间的距离以及文件之间的距离是 巨大的。有人可以说如何降低这一距离吗?
This is my code:
ExpansionPanel(
headerBuilder: (BuildContext context, bool isExpanded) {
return SizedBox(
//height: 20,
child: ListTile(
title: Text("Files (2)"),
leading: Icon(Icons.folder_outlined),
minLeadingWidth : 4,
contentPadding: EdgeInsets.symmetric(vertical: 0.0, horizontal: 16.0),
),
);
},
body: Column(
children: [
ListTile(
title: Text("File_0"),
leading: Icon(Icons.insert_drive_file),
minLeadingWidth : 4,
contentPadding: EdgeInsets.symmetric(vertical: 0.0, horizontal: 16.0),
),
ListTile(
title: Text("File_1"),
leading: Icon(Icons.insert_drive_file),
minLeadingWidth : 4,
contentPadding: EdgeInsets.symmetric(vertical: 0.0, horizontal: 16.0),
)
],
),
isExpanded: items[0].isExpanded,
),
And this is the result:
As you see the distance between Folder and files and between files is huge. Could anyone say how to decrease this distance?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以修改
扩展Panellist
调用ExpandedHeaderPadding
上的空间/填充。ListTile提供基于
您创建自定义行小部件的默认高度。
More about
expandedHeaderPadding
andexpassionpanellist
flutter.dev上。You can modify the space/padding on
ExpansionPanelList
callingexpandedHeaderPadding
.listTile provide default height based on
You can create custom row widget for this.
More about
expandedHeaderPadding
andExpansionPanelList
on flutter.dev.