我试图弄清楚如何改变ListTile中组件的格式。更具体地说,是尾随和标题位置。第一个图像是如何通常它看起来对我来说(caviat是我可以很容易地删除字幕),第二个是我希望它看起来如何。
这可以实现吗?
代码示例:
return Card(
child: ExpansionTile(
leading: ListImage(
image: "path",
),
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Name",
style: const TextStyle(fontWeight: FontWeight.bold),
),
Text("Number")
],
),
trailing: Text('12'),
),
);
2条答案
按热度按时间cngwdvgl1#
您可以使用列将尾部括起来:
i86rm4rw2#
我认为你不能直接将ListTile中的尾部小部件移到右上方,因为ListTile有特定的布局结构。我试着弄明白了几次没有得到我想要的结果。相反,我可以通过使用Stack小部件来解决这个问题。
这里有一个例子:
对我很有效。