Children ExpansionTile Flutter

问题描述 投票:1回答:1

在为其设置填充时扩展ExpansionTile时如何删除分隔线?

return Card(
      borderOnForeground: false,
      key: Key("${e.id}"),
      child: Padding(
        padding: EdgeInsets.only(bottom: 8.0),
        child: ExpansionTile(
          backgroundColor: Theme.of(context).accentColor,
          title: Text(
            e.title,
            style: Theme.of(context).textTheme.bodyText1,
            maxLines: 1,
          ),
          subtitle: Text(e.by),
          children: <Widget>[
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceAround,
              children: <Widget>[ Text("${e.descendants} comments"),Icon(Icons.open_in_new)],)
          ],
        ),
      ),
    );

这是我的屏幕截图enter image description here

flutter divider
1个回答
0
投票
Theme(
      data: Theme.of(context).copyWith(dividerColor: Colors.transparent),
      child: ExpansionTile(/*youdata*/));

您可以使用上面的主题包装ExpansionTile以实现此目的。

© www.soinside.com 2019 - 2024. All rights reserved.