feat(home): 顶部导航随翻页联动并把推荐更名为精选

This commit is contained in:
Vicky authored and trae-solo-agent committed 2026-10-30 22:53:15 +08:00
1 parent 2f4593a46e
commit 335e5dc286
27 files changed
+1095 -214

No files matched your search

+13 -6
View File
@@ -44,11 +44,11 @@ void main() {
final recommendText = tester.widget<Text>(
find.descendant(
of: find.byKey(const Key('recommend-tab-recommend')),
matching: find.text('Recommend'),
matching: find.text('Featured'),
),
);
expect(recommendText.style?.fontSize, 17);
expect(recommendText.style?.fontWeight, FontWeight.w700);
expect(recommendText.style?.fontSize, 18);
expect(recommendText.style?.fontWeight, FontWeight.w400);
expect(recommendText.style?.color, AppColors.textPrimary);
final playlistText = tester.widget<Text>(
find.descendant(
@@ -56,10 +56,17 @@ void main() {
matching: find.text('Playlists'),
),
);
expect(playlistText.style?.fontSize, 17);
expect(playlistText.style?.fontSize, 18);
// 字形度量固定,未选中态靠绘制缩放和灰色区分,切换时不重新排版。
expect(playlistText.style?.fontWeight, FontWeight.w400);
// 新版顶部 tab 未选中态也用主文字色,选中态只靠字重和下划线区分。
expect(playlistText.style?.color, AppColors.textPrimary);
expect(playlistText.style?.color, AppColors.homeTabInactive);
final playlistScale = tester.widget<Transform>(
find.descendant(
of: find.byKey(const Key('recommend-tab-playlist')),
matching: find.byType(Transform),
),
);
expect(playlistScale.transform.entry(0, 0), closeTo(0.9, 0.0001));
expect(
tester
.widget<IconButton>(find.byKey(const Key('recommend-search')))