feat(flutter): 首页改为沉浸式 feed 流

This commit is contained in:
Zhou Weidong committed 2026-10-20 13:35:09 +08:00
1 parent 698fb12e07
commit b7926d64a5
5 files changed
+55 -240

No files matched your search

+7 -10
View File
@@ -64,11 +64,13 @@ void main() {
),
);
await tester.pumpAndSettle();
// 首页 feed 启动会创建首个播放器,先清掉再统计剧场播放器。
created.clear();
await _openTheaterPlayer(tester);
expect(created, hasLength(2));
expect(find.byType(CircularProgressIndicator), findsNothing);
await tester.drag(find.byType(PageView), const Offset(0, -550));
await tester.drag(find.byType(PageView).last, const Offset(0, -550));
await tester.pumpAndSettle();
expect(
@@ -79,19 +81,14 @@ void main() {
expect(created.toSet(), hasLength(3));
});
testWidgets('should_open_fullscreen_player_when_home_card_is_tapped', (
testWidgets('should_open_fullscreen_player_when_theater_card_is_tapped', (
tester,
) async {
await tester.pumpWidget(appUnderTest());
await tester.pumpAndSettle();
await tester.ensureVisible(
find.byKey(const Key('home-drama-card-the-signal-demo')),
);
await tester.pumpAndSettle();
await tester.tap(find.byKey(const Key('home-drama-card-the-signal-demo')));
await tester.pumpAndSettle();
await _openTheaterPlayer(tester);
final player = tester.widget<PlayerPage>(find.byType(PlayerPage));
final player = tester.widget<PlayerPage>(find.byType(PlayerPage).last);
expect(player.homeMode, isFalse);
expect(find.byKey(const Key('player-controls-top')), findsOneWidget);
});
@@ -121,7 +118,7 @@ void main() {
await tester.binding.handlePopRoute();
await tester.pumpAndSettle();
expect(find.byKey(const Key('home-browse-page')), findsOneWidget);
expect(find.byKey(const Key('home-feed-title')), findsOneWidget);
await tester.tap(find.byKey(const Key('tab-create')));
await tester.pumpAndSettle();