fix(player): 改用墙钟驱动飘心动画

This commit is contained in:
Zhou Weidong committed 2026-10-26 19:07:56 +08:00
1 parent c0f65042e6
commit 978c309cd7
6 files changed
+235 -100

No files matched your search

+17 -1
View File
@@ -680,6 +680,7 @@ void main() {
}
await tester.pump();
await tester.pump(const Duration(milliseconds: 300));
await _waitForBufferedHeartFrames(tester);
expect(logic.session.userWantsPlay, isTrue);
expect(find.byKey(const Key('player-play-toggle')), findsNothing);
@@ -699,7 +700,7 @@ void main() {
AppColors.doubleTapHeartRed,
);
await tester.pump(const Duration(milliseconds: 2300));
await _waitForHeartCompletion(tester);
expect(find.byKey(const Key('double-tap-heart-0')), findsNothing);
expect(logic.session.userWantsPlay, isTrue);
});
@@ -723,6 +724,7 @@ void main() {
await tester.tapAt(const Offset(80, 300));
await tester.pump();
await tester.pump(const Duration(milliseconds: 300));
await _waitForBufferedHeartFrames(tester);
expect(logic.session.userWantsPlay, isTrue);
expect(interactions.likeTargets, hasLength(1));
@@ -1818,6 +1820,20 @@ Future<void> _clearFromMore(WidgetTester tester) async {
await tester.pumpAndSettle();
}
Future<void> _waitForBufferedHeartFrames(WidgetTester tester) async {
await tester.runAsync(
() => Future<void>.delayed(const Duration(milliseconds: 120)),
);
await tester.pump(const Duration(milliseconds: 120));
}
Future<void> _waitForHeartCompletion(WidgetTester tester) async {
await tester.runAsync(
() => Future<void>.delayed(const Duration(milliseconds: 1700)),
);
await tester.pump(const Duration(milliseconds: 16));
}
Future<void> _openSeriesPlayer(
WidgetTester tester, {
Key cardKey = const Key('home-feed-card-city-lights-demo'),