Flutter LBS 到 KG 设计
Flutter LBS to KG design
我正在尝试制作我在此处绘制的设计:
我现在的代码是:
@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(" 不期望参数。
将您的按钮包装成子按钮:[ ... ]
Row(
children: <Widget>[
new RaisedButton(
onPressed: null,
child: Text('Convert'),
),
new RaisedButton(
onPressed: null,
child: Text('Swap'),
],
)
我正在尝试制作我在此处绘制的设计:
我现在的代码是:
@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(" 不期望参数。
将您的按钮包装成子按钮:[ ... ]
Row(
children: <Widget>[
new RaisedButton(
onPressed: null,
child: Text('Convert'),
),
new RaisedButton(
onPressed: null,
child: Text('Swap'),
],
)