尝试将容器与 TextView subview 右对齐,它有一个父行位于另一列内,尝试了 Stack Overflow 的多种解决方案,但均无效。
代码
///Transactions Heading
new Column(
children: <Widget>[
new Row(
children: <Widget>[
new Container(
alignment: Alignment.centerLeft,
margin: new EdgeInsets.only(top: 20.0, left: 10.0),
child: new Text(
"Transactions",
style: new TextStyle(
color: primaryTextColor,
fontSize: 25.0,
fontWeight: FontWeight.w700,
letterSpacing: 0.1,
),
),
),
new Container(
margin: new EdgeInsets.only(top: 25.0),
child: new Text(
currentGoalTransactions.length.toString() + " items",
style: new TextStyle(
color: darkHeadingsTextColor, fontSize: 15.0),
),
),
],
),
]);
想要将 2 项文本向右对齐
最佳答案
使用 Row
小部件中的 mainAxisAlignment
属性。
new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
...
)
关于 flutter |右对齐不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50640161/