feat(recommend): 对齐沉浸式推荐页视觉布局

This commit is contained in:
Zhou Weidong committed 2026-10-22 19:42:22 +08:00
1 parent 77689a3eaa
commit 5dd3492aea
17 files changed
+831 -398

No files matched your search

@@ -35,6 +35,55 @@ void main() {
expect(find.byKey(const Key('recommend-tab-playlist')), findsOneWidget);
expect(find.byKey(const Key('recommend-tab-all')), findsOneWidget);
expect(find.byKey(const Key('recommend-feed-player')), findsOneWidget);
final recommendText = tester.widget<Text>(
find.descendant(
of: find.byKey(const Key('recommend-tab-recommend')),
matching: find.text('Recommend'),
),
);
expect(recommendText.style?.fontSize, 17);
expect(recommendText.style?.fontWeight, FontWeight.w700);
expect(recommendText.style?.color, AppColors.textPrimary);
final playlistText = tester.widget<Text>(
find.descendant(
of: find.byKey(const Key('recommend-tab-playlist')),
matching: find.text('Playlists'),
),
);
expect(playlistText.style?.fontSize, 17);
expect(playlistText.style?.fontWeight, FontWeight.w400);
expect(playlistText.style?.color, AppColors.textTabInactive);
expect(
tester
.widget<IconButton>(find.byKey(const Key('recommend-search')))
.iconSize,
26,
);
final topNavRect = tester.getRect(
find.byKey(const Key('recommend-top-nav')),
);
expect(
tester.getRect(find.byKey(const Key('recommend-search'))).right,
closeTo(topNavRect.right - AppDimens.feedPageHorizontal, 0.1),
);
final tabGroupLeft = tester
.getRect(find.byKey(const Key('recommend-tab-recommend')))
.left;
final tabGroupRight = tester
.getRect(find.byKey(const Key('recommend-tab-all')))
.right;
expect(
(tabGroupLeft + tabGroupRight) / 2,
closeTo(topNavRect.center.dx, 0.1),
);
expect(
tester
.getRect(find.byKey(const Key('recommend-top-nav')))
.overlaps(
tester.getRect(find.byKey(const Key('recommend-feed-player'))),
),
isTrue,
);
final player = tester.widget<PlayerPage>(
find.byKey(const Key('recommend-feed-player')),
);