fix(flutter): feed 长按加速与刷新转圈

This commit is contained in:
Zhou Weidong committed 2026-10-20 14:19:14 +08:00
1 parent 564c0dbbef
commit ea9ea6e606
5 files changed
+317 -103

No files matched your search

+33 -1
View File
@@ -118,10 +118,42 @@ void main() {
.getRect(find.byKey(const Key('home-feed-series-meta')))
.top;
expect(railTop, greaterThan(844 * 0.35));
expect(railTop, greaterThan(844 * 0.45));
expect(railBottom, lessThanOrEqualTo(infoTop));
});
testWidgets('should_boost_feed_on_side_long_press', (tester) async {
await _pumpApp(tester);
expect(find.byKey(const Key('home-feed-title')), findsOneWidget);
final gesture = await tester.startGesture(const Offset(60, 300));
await tester.pump(const Duration(milliseconds: 700));
await tester.pump();
expect(find.byKey(const Key('home-feed-speed-boost-hint')), findsOneWidget);
expect(find.byKey(const Key('home-feed-full-series')), findsOneWidget);
expect(find.byKey(const Key('home-feed-title')), findsNothing);
expect(find.byKey(const Key('rail-save')), findsNothing);
await gesture.up();
await tester.pumpAndSettle();
expect(find.byKey(const Key('home-feed-speed-boost-hint')), findsNothing);
expect(find.byKey(const Key('home-feed-title')), findsOneWidget);
expect(find.byKey(const Key('rail-save')), findsOneWidget);
});
testWidgets('should_open_more_sheet_on_center_long_press', (tester) async {
await _pumpApp(tester);
final gesture = await tester.startGesture(const Offset(195, 300));
await tester.pump(const Duration(milliseconds: 700));
await tester.pump();
await gesture.up();
await tester.pumpAndSettle();
expect(find.byKey(const Key('home-feed-clear')), findsOneWidget);
});
testWidgets('should_restore_light_theme_after_leaving_feed_tab', (
tester,
) async {