【发布时间】:2022-11-22 17:17:31
【问题描述】:
这个问题和this post完全一样
但我没有从帖子中找到答案。
和右侧的其他两个按钮。 链接中的解决方案都将标题小部件稍微放在左侧。
有谁知道如何在不使用 Stack 的情况下做到这一点?当标题太长时,我担心标题小部件会覆盖按钮小部件。
编码:
SizedBox(
height: 40,
width: MediaQuery.of(context).size.width,
child: Row(
children: [
const SizedBox(width: 17),
Text(
'TITLE',
style: const TextStyle(
color: Colors.white, fontSize: 30, fontWeight: FontWeight.w500),
),
Spacer(),
Row(
children: [
GestureDetector(
onTap: (){null;},
child: SizedBox(
child: Icon(Icons.wallet_membership, color: Colors.white),
),
),
const SizedBox(width: 17),
GestureDetector(
onTap: (){Get.toNamed('/wallet_setting');},
child: const SizedBox(
child: Icon(Icons.settings, color: Colors.white),
),
),
]
)
]
),
)
【问题讨论】:
-
你能包括你目前的 sn-p 吗?
-
当前状态的代码或屏幕截图?我只需要一个合适的结构来让它工作。我也没有包含代码,因为它无论如何都不起作用
-
你在专栏上使用它吗?
-
是的,它在 Column 小部件上