颤振LBS到KG设计

时间:2018-10-24 09:06:08

标签: flutter flutter-layout

我正在尝试设计在这里绘制的图形:

enter image description here

我的代码现在是:

  @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行。 “ new Row(”不需要参数。

1 个答案:

答案 0 :(得分:2)

将按钮包装成一个孩子:[...]

Row(
        children: <Widget>[
                    new RaisedButton(
                    onPressed: null,
                    child: Text('Convert'),
                  ),
                  new RaisedButton(
                    onPressed: null,
                    child: Text('Swap'),
            ],
        )