【发布时间】:2019-04-08 01:35:43
【问题描述】:
代码:
new Container(
alignment: FractionalOffset.center,
child: new Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
new FlatButton(
child: new Text('Don\'t have an account?', style: new TextStyle(color: Color(0xFF2E3233))),
),
new FlatButton(
child: new Text('Register.', style: new TextStyle(color: Color(0xFF84A2AF), fontWeight: FontWeight.bold),),
onPressed: moveToRegister,
)
],
),
),
结果如下:https://dartpad.dev/?id=6bbfc6139bdf32aa7b47eebcdf9623ba
如何解决两个FlatButton 元素并排并排在屏幕宽度中心之间没有空格的问题?
【问题讨论】:
-
你试过了吗:
MainAxisAlignment.spaceAround? -
添加大小框。检查这个mightytechno.com/flutter-row-widget
标签: flutter dart flutter-layout