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