【发布时间】:2022-03-06 04:06:19
【问题描述】:
我需要在两个小部件之间创建一条垂直线,如下所示:https://imgur.com/a/22ybF6o
我可以这样做,但要固定大小。如果这个尺寸发生变化,布局就会变得像这样混乱:https://imgur.com/a/kO9NXlJ
这是我的代码:
Widget listItem(TripsData item) {
var startDate = DateFormat('dd/MM/yy - HH:mm').format(DateTime.parse(item.start));
var endDate = DateFormat('dd/MM/yy - HH:mm').format(DateTime.parse(item.end));
return Card(
child: Stack(
children: <Widget>[
drawDestinationLine(Colors.red),
Column(
children: <Widget>[
ListTile(
leading: drawDestinationCircle('A', Colors.blue),
title: Text(startDate),
subtitle: Text(item.locationStart),
),
const Padding(padding: EdgeInsets.only(bottom: 2.0)),
ListTile(
leading: drawDestinationCircle('B', Colors.blue),
title: Text(endDate),
subtitle: Text(item.locationEnd),
),
],
),
],
),
);
}
有人可以帮我解决这个问题吗?
如果需要更多代码,请告诉我,但 StackOverflow 没有让我在这里放更多代码..
【问题讨论】: