如何降低 Flutter expansionTile 的高度

How to reduce Flutter expansionTile height

我想降低 expansionTile 的高度,

我试过ConfigurableExpansionTile但是它不支持空安全,所以我不能在我的项目中使用它。

我也将我的 ExpansionTile 包裹在 ListTileTheme 中:

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
 )