【问题标题】:How to manage widget in row(flutter) one to the left and another one to the right如何管理行中的小部件(颤动)一个在左边,另一个在右边
【发布时间】:2021-06-17 05:06:45
【问题描述】:
                    mainAxisAlignment: MainAxisAlignment.spaceAround,
                    children: [
                      Icon(Icons.money_rounded,size: 30,),
                      Text('เงินสด',
                        style: TextStyle(
                          color: Colors.grey[700],
                          fontWeight: FontWeight.bold,
                        ),
                      ),
                      Text('1000 THB',
                        style: TextStyle(
                          color: Colors.grey[700],
                          fontWeight: FontWeight.bold,
                        ),
                      ),
                      RaisedButton(
                        shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
                        onPressed: (){

                        },
                        child: Icon(Icons.add_outlined),
                      ),
                    ],
                  )

根据代码,他们像这样平均分配该行中的所有小部件(bc MainAxisAlignment.spaceAround)
----------------------------------------------
|...图标...|...文字...|...文字...|..按钮..|
----------------------------------------------
但我想将第一个图标和第一个文本分组到左侧,另外两个分组到这一行的右侧。 像这样
---------------------------------------------
|图标 |文字|........|文字|按钮 |
---------------------------------------------
对不起,我不会画,所以我希望你知道我想说什么。

【问题讨论】:

    标签: flutter dart widget flutter-layout


    【解决方案1】:

    Spacer() 小部件放在它们之间,这样就可以了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-24
      • 1970-01-01
      • 1970-01-01
      • 2012-09-02
      • 1970-01-01
      • 2018-09-02
      相关资源
      最近更新 更多