fix(flutter): 首页 feed 顶栏固定悬浮

This commit is contained in:
Zhou Weidong committed 2026-10-20 14:46:08 +08:00
1 parent 1cb4c56261
commit 9175a7f253
6 files changed
+341 -345

No files matched your search

+15
View File
@@ -170,12 +170,14 @@ void main() {
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);
expect(find.byKey(const Key('home-feed-search')), 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);
expect(find.byKey(const Key('home-feed-search')), findsOneWidget);
});
testWidgets('should_resume_playback_when_boosting_while_paused', (
@@ -243,6 +245,19 @@ void main() {
expect(after, isNot(before));
});
testWidgets('should_keep_feed_header_fixed_when_swiping', (tester) async {
await _pumpApp(tester);
final before = tester.getRect(find.byKey(const Key('home-feed-search')));
await tester.drag(find.byType(PageView).first, const Offset(0, -600));
await tester.pumpAndSettle();
final after = tester.getRect(find.byKey(const Key('home-feed-search')));
expect(after.top, closeTo(before.top, 0.5));
expect(find.byKey(const Key('home-feed-tab-recommend')), findsOneWidget);
expect(find.byKey(const Key('home-feed-refresh')), findsOneWidget);
});
testWidgets('should_resume_feed_after_returning_from_full_player', (
tester,
) async {