如何在Flutter中并排显示按钮?

666*_*666 8 layout flutter

我希望水平地将我的两个按钮彼此相邻显示.到目前为止,我只能从上到下显示它们.

使用以下代码,我需要更改什么?

new Container(
    child: new Column(

      children: <Widget>[

      new RaisedButton(
        child: new Text("LogIn"),
        color:  Colors.blueAccent[600],
        onPressed: null,
        ),


      new RaisedButton(
        child: new Text("SignUp"),
        color:  Colors.blueAccent[600],
        onPressed: null,
        ),


      ],
    ),
  ),
Run Code Online (Sandbox Code Playgroud)

Ren*_*ene 13

列是垂直排列的项目(因此是列),您正在寻找Row.只需将Row替换为Row,其余代码就可以了.如果要填充所有可用空间,也可以使用Expanded.


Jan*_*col 10

Wrap(
            children: <Widget>[
              RaisedButton(
                ...
              ),
              RaisedButton(
                ...
              ),
              RaisedButton(
                ...
              ),
            ],
          ),
Run Code Online (Sandbox Code Playgroud)