【发布时间】:2020-12-17 12:30:48
【问题描述】:
我在两个内容相同的容器中有不同的垂直间距。我用不同的小部件尝试过它,它总是一样的。 “卡片”小部件包含一个带有两个相同“容器”的“列”,每个容器包含一个相同的“ListTile”和一个相同的“子项:文本”。 如何使垂直距离相等且尽可能小?
Container(
width: screenWidth * 0.5, height: 300,
padding: EdgeInsets.all(10),
child: Column(
children: <Widget>[
Container(
width: screenWidth * 0.5, height: 280,
padding: EdgeInsets.all(1),
child: Card(
shape: RoundedRectangleBorder(
borderRadius: const BorderRadius.all(Radius.circular(8.0),),
side: BorderSide(
color: Colors.black,
width: 1.0,),
),
color: Colors.white,
elevation: 4.0,
shadowColor: Colors.blue,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children:[
Container(
padding: EdgeInsets.all(0.0),
margin: EdgeInsets.all(0.0),
decoration: BoxDecoration(
color: Colors.yellow,
border: Border.all(color: Colors.black),
),
child: ListTile(
contentPadding: EdgeInsets.symmetric(vertical: 0.0, horizontal: 5.0),
dense: true,
isThreeLine: false,
title: Text(
selTitle,
style: TextStyle(
color:Colors.black,
//backgroundColor: Colors.limeAccent,
backgroundColor: selColor(selIndex),
fontSize: 20,
fontWeight: FontWeight.bold,
),
)
)
),
Container(
padding: EdgeInsets.all(0.0),
margin: EdgeInsets.all(0.0),
decoration: BoxDecoration(
color: Colors.yellow,
border: Border.all(color: Colors.black),
),
child: ListTile(
contentPadding: EdgeInsets.symmetric(vertical: 0.0, horizontal: 5.0),
dense: true,
isThreeLine: false,
title: Text(
"noch ein sehr langer Text: jihiuwh uewua8h ieshg lisru hirluh spi",
style: TextStyle(
backgroundColor: myBTN_HELLGRAU,
fontSize: 16,
)
),
)
)
]
)
),
)
]
)
),
see details 和 here is the whole application
“安道尔”中的垂直距离远大于下面的文字。 如何使上部字段中的间距变小?
【问题讨论】:
-
但我不知道为什么