fix(stickman): 使用顶部对齐实现昵称与数量标签的中心对齐
昵称标签和数量标签高度相同,顶部对齐即可实现水平中心对齐 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
d4b802502e
commit
50bc5a5a20
|
|
@ -256,12 +256,10 @@ class _StickmanRaceWidgetState extends State<StickmanRaceWidget>
|
||||||
top: verticalPosition - bounce,
|
top: verticalPosition - bounce,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.end, // 底部对齐
|
crossAxisAlignment: CrossAxisAlignment.start, // 顶部对齐,昵称和数量标签高度相同,自然中心对齐
|
||||||
children: [
|
children: [
|
||||||
// 昵称标签 - 固定在左边,与数量标签底部对齐
|
// 昵称标签 - 与数量标签顶部对齐(两者高度相近,实现中心对齐)
|
||||||
Padding(
|
SizedBox(
|
||||||
padding: const EdgeInsets.only(bottom: 38), // 火柴人高度36 + 间距2
|
|
||||||
child: SizedBox(
|
|
||||||
width: nicknameAreaWidth,
|
width: nicknameAreaWidth,
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 2),
|
padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 2),
|
||||||
|
|
@ -290,7 +288,6 @@ class _StickmanRaceWidgetState extends State<StickmanRaceWidget>
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
// 火柴人和数量标签
|
// 火柴人和数量标签
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: stickmanBoxWidth.clamp(60.0, double.infinity),
|
width: stickmanBoxWidth.clamp(60.0, double.infinity),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue