如何管理行中的小部件(颤动),一个在左边,另一个在右边


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(,如下所示
----------------------------------------------------
|。。。图标…|。。。文本…|。。。文本…|。。按钮|
-----------------------------------------------------------
但我想将第一个图标和第一个文本分组到这一行的左边,其他两个分组到右边。像这样
---------------------------------------------
|icon|text||text|button|
--------------------------------------------
对不起,我画不出来,所以我希望你知道我想说什么。

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

相关内容

最新更新