码:
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,
)
],
),
),
Run Code Online (Sandbox Code Playgroud)
这是结果:https:
//www.dropbox.com/s/sxklyutyvbbura8/Screenshot_20181104-150928.png?dl = 0
如何确定两个FlatButton元素并排,屏幕宽度中心之间没有空间?
我正在开发 Flutter 应用程序。
我有这个飞镖代码:
List<Widget> buildInputs() {
return[
new Container(
padding: new EdgeInsets.only(
top: 20.0,
right: 40.0,
left: 40.0,
),
child: new Column(
children: <Widget>[
new TextFormField(
decoration: new InputDecoration(labelText: 'E-Mail', contentPadding: new EdgeInsets.only(bottom: 1.0)),
validator: (value) => value.isEmpty ? 'Email can\'nt be empty' : null,
onSaved: (value) => _email = value,
),
new TextFormField(
decoration: new InputDecoration(labelText: 'Password', contentPadding: new EdgeInsets.only(bottom: 1.0)),
obscureText: true,
validator: (value) => value.isEmpty ? 'Password can\'nt be empty' : null,
onSaved: (value) => _password …Run Code Online (Sandbox Code Playgroud)