fix(player): 恢复develop飘心实现
This commit is contained in:
1 parent
9039b27c7f
commit
84b24775d6
6 files changed
+107
-225
No files matched your search
@@ -144,7 +144,7 @@ void main() {
|
||||
expect(find.byKey(const Key('double-tap-heart-0')), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('heart overlay starts at global tap position and is cleaned up', (
|
||||
testWidgets('heart burst is cleaned up when gesture region is disposed', (
|
||||
tester,
|
||||
) async {
|
||||
final key = GlobalKey<_HarnessState>();
|
||||
@@ -165,19 +165,14 @@ void main() {
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 1));
|
||||
|
||||
final firstHeart = find.byKey(const Key('double-tap-heart-0'));
|
||||
expect(firstHeart, findsOneWidget);
|
||||
expect(
|
||||
(tester.getCenter(firstHeart) - tapPosition).distance,
|
||||
lessThanOrEqualTo(1),
|
||||
);
|
||||
expect(find.byType(PlayerDoubleTapHeartBurst), findsOneWidget);
|
||||
|
||||
await tester.pumpWidget(const SizedBox.shrink());
|
||||
await tester.pump();
|
||||
expect(find.byType(PlayerDoubleTapHeartBurst), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('multiple heart overlays run independently', (tester) async {
|
||||
testWidgets('multiple heart bursts run independently', (tester) async {
|
||||
final key = GlobalKey<_HarnessState>();
|
||||
final clock = _TestClock();
|
||||
await _pumpHarness(
|
||||
@@ -205,9 +200,6 @@ void main() {
|
||||
await tester.pump(const Duration(milliseconds: 1));
|
||||
|
||||
expect(find.byType(PlayerDoubleTapHeartBurst), findsNWidgets(2));
|
||||
expect(find.byKey(const ValueKey('heart-overlay-0')), findsOneWidget);
|
||||
expect(find.byKey(const ValueKey('heart-overlay-1')), findsOneWidget);
|
||||
|
||||
await tester.pumpWidget(const SizedBox.shrink());
|
||||
await tester.pump();
|
||||
expect(find.byType(PlayerDoubleTapHeartBurst), findsNothing);
|
||||
|
||||
Reference in new issue
Block a user