fix(mobile-app): 为每个火柴人跑道添加独立终点旗帜
- 移除单一的共享终点旗帜 - 为每个跑道生成独立的红旗,与火柴人垂直位置对齐 🤖 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
63cf52b9c1
commit
0a64024773
|
|
@ -171,6 +171,10 @@ class _StickmanRaceWidgetState extends State<StickmanRaceWidget>
|
|||
final trackCount = sortedRankings.length;
|
||||
final raceTrackHeight = (trackCount * _minTrackHeight).clamp(160.0, double.infinity);
|
||||
|
||||
// 计算每个跑道的高度和位置
|
||||
final usableHeight = raceTrackHeight - 40;
|
||||
final trackHeight = usableHeight / trackCount;
|
||||
|
||||
return SizedBox(
|
||||
height: raceTrackHeight,
|
||||
child: Stack(
|
||||
|
|
@ -184,31 +188,19 @@ class _StickmanRaceWidgetState extends State<StickmanRaceWidget>
|
|||
),
|
||||
),
|
||||
|
||||
// 终点红旗
|
||||
Positioned(
|
||||
right: 8,
|
||||
top: 0,
|
||||
bottom: 40,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: const [
|
||||
Icon(
|
||||
Icons.flag,
|
||||
color: Colors.red,
|
||||
size: 32,
|
||||
),
|
||||
SizedBox(height: 4),
|
||||
Text(
|
||||
'终点',
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
fontFamily: 'Inter',
|
||||
color: Color(0xFF8B5A2B),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// 每个跑道的终点红旗
|
||||
...List.generate(trackCount, (index) {
|
||||
final verticalPosition = index * trackHeight + 10 + trackHeight / 2 - 16;
|
||||
return Positioned(
|
||||
right: 8,
|
||||
top: verticalPosition,
|
||||
child: const Icon(
|
||||
Icons.flag,
|
||||
color: Colors.red,
|
||||
size: 24,
|
||||
),
|
||||
);
|
||||
}),
|
||||
|
||||
// 火柴人们
|
||||
...sortedRankings.asMap().entries.map((entry) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue