首页 > 解决方案 > 具有行和列的颤动布局

问题描述

我是新来的颤振我想创建颤振布局作为图像请帮助。提前致谢。

像这样的布局

标签: flutterlayout

解决方案


试试这个:

Row(
          mainAxisSize: MainAxisSize.min,
          children: [
            Container(
              width: 150,
              child: Column(
                mainAxisSize: MainAxisSize.min,
                children: [
                  SizedBox(height: 40),
                  Text("UserName"),
                  SizedBox(height: 20),
                  Text("Password"),
                  RaisedButton(
                    color: Colors.grey,
                    onPressed: () {},
                    child: Text("OK"),
                  ),
                ],
              ),
            ),
            Column(
              mainAxisSize: MainAxisSize.min,
              children: [
                Container(
                  width: 200,
                  child: TextFormField(),
                ),
                Container(
                  width: 200,
                  child: TextFormField(),
                ),
                RaisedButton(
                  color: Colors.grey,
                  onPressed: () {},
                  child: Text("Cancel"),
                ),
              ],
            ),
          ],
        ),

推荐阅读