我正在尝试使用 VerticalDivider
用于分隔 Row
中的项目的小部件. Here是整个 body 。
行:
Row(
children: <Widget>[
Text('420 Posts', style: TextStyle(color: Color(0xff666666)),),
VerticalDivider(
thickness: 2,
width: 20,
color: Colors.black,
),
Text('420 Posts', style: TextStyle(color: Color(0xff666666)),)
],
),
最佳答案
包裹您的 Row
与 IntrinsicHeight
,
IntrinsicHeight(
child: Row(
children: <Widget>[
Text('420 Posts', style: TextStyle(color: Color(0xff666666)),),
VerticalDivider(
thickness: 2,
width: 20,
color: Colors.black,
),
Text('420 Posts', style: TextStyle(color: Color(0xff666666)),)
],
),
)
关于flutter - 垂直分隔线未显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59960153/