我想垂直对齐左侧元素,并与带有填充的右侧元素相同,这就是我得到的结果,元素未对齐,并且我无法在第二行中插入填充,以便左侧元素对齐
return InkWell(
child: Column(
children: <Widget>[
Row(
children:<Widget> [
Padding(padding:EdgeInsets.fromLTRB(18.0, 0.0, 0.0, 0.0)),
Text(
product.libelle,
style: theme.textTheme.title,
maxLines: 1,
textAlign: TextAlign.left,
),]),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children:<Widget> [
Text(
product.description,
style: theme.textTheme.subtitle,
maxLines: 1,
),
RaisedButton( onPressed: () {},
child: new Text("S\'abonner"),
)
]),
),
);
Run Code Online (Sandbox Code Playgroud)
小智 20
使用文本小部件和 TextAlign.justify :)
Text('my String', textAlign: TextAlign.justify),
Run Code Online (Sandbox Code Playgroud)
您会尝试用 Padding 小部件包裹第二行吗?
Padding(
padding: EdgetInsets.symmetric(horizontal: 18.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children:<Widget> [
Text(
product.description,
style: theme.textTheme.subtitle,
maxLines: 1,
),
RaisedButton( onPressed: () {},
child: new Text("S\'abonner"),
)
]),
)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11988 次 |
| 最近记录: |