我有這個 List view.builder
child: ListView.builder(
itemCount: coins.length,
itemBuilder: (BuildContext context, int index) {
return ListTile(
leading: iconsList[index],
title: Wrap(children: [
Row(children: [
Text(
coins[index],
style: const TextStyle(color: Colors.white),
),
Text(
value[index],
style: TextStyle(color: Colors.white),
),
]),
]),
subtitle: Align(
alignment: Alignment.bottomRight,
child: Text(
value[index],
style: TextStyle(color: Colors.white),
),
),
);
}),
在手機螢屏上顯示時看起來像這樣:

我想將歐元金額放在硬幣零錢上方的右上角,如下所示:

我應該如何將金額放入歐元中,以便它看起來像我展示的示例影像?
uj5u.com熱心網友回復:
只需使用mainAxisAlignment: MainAxisAlignment.spaceBetween和crossAxisAlignment: CrossAxisAlignment.center,下Row,無需使用副標題,您只需系結右側元素Column并根據需要更改文本樣式
ListTile(
leading: Icon(Icons.add),
title: Wrap(children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"coins[index]1",
style: const TextStyle(color: Colors.white),
),
Column(
children: [
Text(
"value[index]2",
style: TextStyle(color: Colors.white),
),
Text(
"value[index]3",
style: TextStyle(color: Colors.white),
),
],
)
]),
]),
)
輸出:

轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/392806.html
上一篇:影片不會在頁面開始時觸發
