我想降低 expansionTile 的高度,
我试过了ConfigurableExpansionTile但它不支持空安全,所以我不能在我的项目中使用它。
我还在 ListTileTheme 中包装了我的 ExpansionTile :
return ListTileTheme(
dense: true,
child: ExpansionTile(
它降低了高度,但对我来说仍然不够。
如果您有解决方案,感谢您的帮助。
最佳答案
我不知道 ExpansionTile 但你可以使用 ExpandablePanel ,这可以满足您的目的,您可以轻松自定义小部件的高度。它还支持空安全。
ExpandablePanel(
theme: const ExpandableThemeData(
headerAlignment:
ExpandablePanelHeaderAlignment.center,
//tapBodyToExpand: true,
//tapBodyToCollapse: true,
hasIcon: false,
),
header: Expandable(
collapsed: buildCollapsed(), // widget header when the widget is Collapsed
expanded: buildExpanded(), // header when the widget is Expanded
),
collapsed: Container(), // body when the widget is Collapsed, I didnt need anything here.
expanded: expandedColumn() // body when the widget is Expanded
)
关于flutter - 如何降低 Flutter expansionTile 的高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70695882/