我是 Flutter 的新手。我試圖弄清楚如何將我的 textbutton.icon() 小部件對齊到最右邊,如下圖所示
Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Directionality(
textDirection: TextDirection.rtl,
child: Align(
alignment: Alignment.centerRight,
child: TextButton.icon(
style: ButtonStyle(
foregroundColor:
MaterialStateProperty.all(Colors.red[200]),
),
onPressed: delete,
label: Text('Unfavorite'),
icon: Icon(Icons.heart_broken),
),),
),
我嘗試使用mainAxisAlignment: MainAxisAlignment.end,但它仍然不能很好地對齊。任何幫助表示贊賞
uj5u.com熱心網友回復:
將圖片和帶有 2 個圖示的列設定為 a 的子級Row,并將 row 屬性設定mainAxisAlignment為MainAxisAlignment.spaceBetween。
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
ExamplePhoto(),
Column(
children: [
ExampleIcon(),
ExampleIcon(),
],
),
],
)
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/531079.html
標籤:扑镖
