拨开荷叶行,寻梦已然成。仙女莲花里,翩翩白鹭情。
IMG-LOGO
主页 文章列表 如何减少Flutter扩展瓦片高度

如何减少Flutter扩展瓦片高度

白鹭 - 2022-02-24 2022 0 0

我想降低一个expansionTile的高度,

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

我还将我的ExpansionTile包装在ListTileTheme中:

return ListTileTheme(
      dense: true,
      child: ExpansionTile(

它降低了高度,但对我来说仍然不够。

如果您有解决方案,感谢您的帮助。

uj5u.com热心网友回复:

我不知道 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
 ) 
标签:

0 评论

发表评论

您的电子邮件地址不会被公开。 必填的字段已做标记 *