fix(player): 使用根Overlay渲染飘心

This commit is contained in:
Zhou Weidong committed 2026-10-26 18:29:48 +08:00
1 parent e7afd316f8
commit 30b43878ab
3 files changed
+122 -31

No files matched your search

@@ -14,6 +14,7 @@ class PlayerDoubleTapHeartBurst extends StatefulWidget {
required this.burstId,
required this.onCompleted,
this.random,
this.origin = Offset.zero,
});
static const int minParticleCount = 4;
@@ -23,6 +24,7 @@ class PlayerDoubleTapHeartBurst extends StatefulWidget {
final int burstId;
final VoidCallback onCompleted;
final Random? random;
final Offset origin;
@visibleForTesting
static double opacityForProgress(double progress) =>
@@ -94,7 +96,9 @@ class _PlayerDoubleTapHeartBurstState extends State<PlayerDoubleTapHeartBurst>
debugPrint('[player] phase=heart-burst-init id=${widget.burstId}');
debugPrint(
'[player] phase=heart-burst-start '
'id=${widget.burstId} count=${_particles.length}',
'id=${widget.burstId} count=${_particles.length} '
'at=${widget.origin.dx.toStringAsFixed(1)},'
'${widget.origin.dy.toStringAsFixed(1)}',
);
}
_controller = AnimationController(
@@ -168,7 +172,7 @@ class _PlayerDoubleTapHeartBurstState extends State<PlayerDoubleTapHeartBurst>
final scale = PlayerDoubleTapHeartBurst.scaleForProgress(progress);
return Positioned(
left: particle.drift * move - particle.size / 2,
top: -particle.travel * move,
top: -particle.size / 2 - particle.travel * move,
child: Opacity(
opacity: PlayerDoubleTapHeartBurst.opacityForProgress(progress),
child: Transform.scale(