Flutter 颤振LBS-KG设计

Flutter 颤振LBS-KG设计,flutter,flutter-layout,Flutter,Flutter Layout,我正在尝试做一个我在这里画的设计: 我的代码是: @override Widget build(BuildContext context) { // Build a Form widget using the _formKey we created above return Form( key: _formKey, child: Column( crossAxisAlignment: CrossAxisAlignment.star

我正在尝试做一个我在这里画的设计:

我的代码是:

  @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'),
              )

          ),
        ],
      ),
    );
  }
@覆盖
小部件构建(构建上下文){
//使用上面创建的_formKey构建表单小部件
报税表(
键:_formKey,
子:列(
crossAxisAlignment:crossAxisAlignment.start,
儿童:[
新文本(
“LBS:”,
),
TextFormField(
验证器:(值){
if(value.isEmpty){
返回“请输入LBS”;
}
},
),
新文本(
"公斤",,
),
新文本(
“{kg值}”,
),
新行(
新升起的按钮(
onPressed:null,
子项:文本('Convert'),
),
新升起的按钮(
onPressed:null,
子项:文本('Swap'),
)
),
],
),
);
}
我的问题是我想在新行有两个按钮。
“新行(“不需要参数。

将按钮包装成子项:[……]

Row(
        children: <Widget>[
                    new RaisedButton(
                    onPressed: null,
                    child: Text('Convert'),
                  ),
                  new RaisedButton(
                    onPressed: null,
                    child: Text('Swap'),
            ],
        )
行(
儿童:[
新升起的按钮(
onPressed:null,
子项:文本('Convert'),
),
新升起的按钮(
onPressed:null,
子项:文本('Swap'),
],
)

您需要将按钮包装成一个
子项:[……]