fix(player): 调整双击飘心动画
This commit is contained in:
1 parent
63296d2a92
commit
bea50ab32f
8 files changed
+52
-20
No files matched your search
@@ -91,7 +91,7 @@ void main() {
|
||||
await tester.tapAt(center);
|
||||
await tester.pump();
|
||||
expect(repository.likeTargets, hasLength(1));
|
||||
await tester.pump(const Duration(milliseconds: 800));
|
||||
await tester.pump(const Duration(milliseconds: 1600));
|
||||
|
||||
clock.advance(const Duration(milliseconds: 500));
|
||||
await tester.pump(const Duration(milliseconds: 500));
|
||||
|
||||
@@ -13,12 +13,33 @@ void main() {
|
||||
home: Scaffold(body: PlayerDoubleTapHeartBurst(onCompleted: _noop)),
|
||||
),
|
||||
);
|
||||
await tester.pump(const Duration(milliseconds: 160));
|
||||
await tester.pump(const Duration(milliseconds: 300));
|
||||
|
||||
expect(find.byIcon(Icons.favorite_rounded), findsNWidgets(3));
|
||||
expect(_size(tester, 0), 48);
|
||||
expect(_size(tester, 1), 36);
|
||||
expect(_size(tester, 2), 40);
|
||||
expect(_size(tester, 0), 44);
|
||||
expect(_size(tester, 1), 34);
|
||||
expect(_size(tester, 2), 38);
|
||||
expect(
|
||||
tester
|
||||
.widgetList<Stack>(
|
||||
find.descendant(
|
||||
of: find.byType(PlayerDoubleTapHeartBurst),
|
||||
matching: find.byType(Stack),
|
||||
),
|
||||
)
|
||||
.every((stack) => stack.clipBehavior == Clip.none),
|
||||
isTrue,
|
||||
);
|
||||
});
|
||||
|
||||
test('heart burst stays long and sparse', () {
|
||||
expect(PlayerDoubleTapHeartBurst.singleHeartDurationMs, 1300);
|
||||
expect(
|
||||
PlayerDoubleTapHeartBurst.animationDuration,
|
||||
greaterThanOrEqualTo(const Duration(milliseconds: 1200)),
|
||||
);
|
||||
expect(PlayerDoubleTapHeartBurst.particleCount, lessThanOrEqualTo(4));
|
||||
expect(PlayerDoubleTapHeartBurst.particleCount, 3);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -679,7 +679,7 @@ void main() {
|
||||
await tester.tapAt(position);
|
||||
}
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 100));
|
||||
await tester.pump(const Duration(milliseconds: 300));
|
||||
|
||||
expect(logic.session.userWantsPlay, isTrue);
|
||||
expect(find.byKey(const Key('player-play-toggle')), findsNothing);
|
||||
@@ -699,7 +699,7 @@ void main() {
|
||||
AppColors.doubleTapHeartRed,
|
||||
);
|
||||
|
||||
await tester.pump(const Duration(milliseconds: 800));
|
||||
await tester.pump(const Duration(milliseconds: 1600));
|
||||
expect(find.byKey(const Key('double-tap-heart-0')), findsNothing);
|
||||
expect(logic.session.userWantsPlay, isTrue);
|
||||
});
|
||||
@@ -722,7 +722,7 @@ void main() {
|
||||
await tester.tapAt(const Offset(80, 300));
|
||||
await tester.tapAt(const Offset(80, 300));
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 100));
|
||||
await tester.pump(const Duration(milliseconds: 300));
|
||||
|
||||
expect(logic.session.userWantsPlay, isTrue);
|
||||
expect(interactions.likeTargets, hasLength(1));
|
||||
|
||||
Reference in new issue
Block a user