feat(app): 完善播放协议搜索与空状态

This commit is contained in:
Zhou Weidong committed 2026-10-23 12:38:47 +08:00
1 parent 671e0ce143
commit ef29fc5f15
85 files changed
+2976 -768

No files matched your search

+28 -1
View File
@@ -154,12 +154,37 @@ void main() {
await tester.pumpAndSettle();
});
testWidgets('feed progress thumb stays on the finger when dragged right', (
tester,
) async {
await _pumpFeedOverlay(tester);
final bar = find.byKey(const Key('home-feed-progress'));
final gesture = await tester.startGesture(tester.getCenter(bar));
await gesture.moveBy(const Offset(800, 0));
await tester.pump();
final thumbCenter = tester
.getRect(find.byKey(const Key('home-feed-progress-thumb')))
.center
.dx;
final playedRight = tester
.getRect(find.byKey(const Key('home-feed-progress-played')))
.right;
expect(thumbCenter, closeTo(tester.getRect(bar).right, 0.5));
expect(playedRight, closeTo(thumbCenter, 0.5));
await gesture.up();
await tester.pumpAndSettle();
});
testWidgets('full player drag clears chrome and release restores it', (
tester,
) async {
await _pumpFullPlayerOverlay(tester);
expect(find.byKey(const Key('player-controls-top')), findsOneWidget);
expect(find.byKey(const Key('player-bottom-actions')), findsOneWidget);
final progressTop = tester.getTopLeft(find.byType(Slider)).dy;
final gesture = await tester.startGesture(
tester.getCenter(find.byKey(const Key('player-progress'))),
@@ -170,8 +195,9 @@ void main() {
expect(_opacity(tester, const Key('player-controls-top')), 0);
expect(_opacity(tester, const Key('player-interaction-rail')), 0);
expect(_offstage(tester, const Key('player-controls-bottom')), isTrue);
expect(_offstage(tester, const Key('player-bottom-actions')), isTrue);
expect(_opacity(tester, const Key('player-bottom-actions')), 0);
expect(find.byKey(const Key('player-progress')), findsOneWidget);
expect(tester.getTopLeft(find.byType(Slider)).dy, progressTop);
await gesture.up();
await tester.pumpAndSettle();
@@ -179,6 +205,7 @@ void main() {
expect(_opacity(tester, const Key('player-controls-top')), 1);
expect(_opacity(tester, const Key('player-interaction-rail')), 1);
expect(_offstage(tester, const Key('player-bottom-actions')), isFalse);
expect(tester.getTopLeft(find.byType(Slider)).dy, progressTop);
});
}