【发布时间】:2020-10-03 13:41:34
【问题描述】:
我正在使用行来显示此文本。但是,当我使用扩展小部件将第二个文本(例如 AMD Ryzen.../30 天...)设为多行时,第一个文本(例如处理器/操作系统)变为垂直居中,我想要那个垂直顶部。我尝试了一些小部件,如对齐等,但没有奏效。
代码:
Widget _specificationRow(String title, String description) {
return new Row(children: [
Padding(
padding: const EdgeInsets.all(5.0),
child: Align(
alignment: Alignment.topRight,
child: Text(
'• $title :',
style: TextStyle(
color: Colors.deepOrange,
fontSize: 15.0,
fontFamily: "GoogleSans"),
),
),
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(5.0),
child: Text(
'$description',
maxLines: 3,
overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 15.0,
fontFamily: "GoogleSans"),
),
),
),
]);
}
【问题讨论】: