【发布时间】:2018-10-24 09:06:07
【问题描述】:
我正在尝试制作我在这里绘制的设计:
我的代码现在是:
@override
Widget build(BuildContext context) {
// Build a Form widget using the _formKey we created above
return Form(
key: _formKey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
new Text(
'LBS: ',
),
TextFormField(
validator: (value) {
if (value.isEmpty) {
return 'Please enter LBS';
}
},
),
new Text(
'KG: ',
),
new Text(
'{kg value} ',
),
new Row(
new RaisedButton(
onPressed: null,
child: Text('Convert'),
),
new RaisedButton(
onPressed: null,
child: Text('Swap'),
)
),
],
),
);
}
我的问题是我想要两个按钮的新行。 "new Row(" 不需要参数。
【问题讨论】:
-
你需要将你的按钮包装成一个
children: <Widget> [ ... ]