feat: 重做首页热播榜布局

This commit is contained in:
Zhou Weidong committed 2026-10-22 22:19:55 +08:00
1 parent db8433ace3
commit 9b83283689
14 files changed
+285 -233

No files matched your search

+14 -8
View File
@@ -117,8 +117,8 @@ void main() {
expect(top3.right, closeTo(376, 0.5));
expect(top2.left, lessThan(top1.left));
expect(top3.left, greaterThan(top1.right));
expect(top1.bottom, closeTo(top2.bottom, 0.5));
expect(top1.bottom, closeTo(top3.bottom, 0.5));
expect(top1.bottom, closeTo(top2.bottom - 12, 0.5));
expect(top2.bottom, closeTo(top3.bottom, 0.5));
expect(find.byKey(const Key('ranking-row-3')), findsNothing);
});
@@ -129,13 +129,19 @@ void main() {
expect(find.byKey(const Key('ranking-row-3')), findsOneWidget);
expect(find.byKey(const Key('ranking-row-2')), findsNothing);
expect(find.byKey(const Key('ranking-top-4')), findsOneWidget);
final rankNumber = tester.widget<Text>(
find.byKey(const Key('ranking-top-4')),
);
expect(rankNumber.data, '4');
expect(rankNumber.style?.fontSize, 48);
expect(rankNumber.style?.fontWeight, FontWeight.w800);
expect(
find.descendant(
of: find.byKey(const Key('ranking-row-3')),
matching: find.text('synopsis'),
),
findsOneWidget,
tester.getSize(find.byKey(const Key('ranking-row-3'))),
const Size(362, 96),
);
expect(
tester.getSize(find.byKey(const Key('ranking-row-cover-4'))),
const Size(60, 80),
);
});
+3 -2
View File
@@ -114,8 +114,9 @@ void main() {
await tester.tap(find.byKey(const Key('home-section-ranking')));
await tester.pumpAndSettle();
expect(find.byKey(const Key('ranking-page')), findsNothing);
expect(firstDramaId(), 'page1-0');
expect(find.byKey(const Key('ranking-page')), findsOneWidget);
expect(find.byKey(const Key('ranking-hero')), findsOneWidget);
expect(find.byKey(const Key('home-grid-cards')), findsNothing);
await tester.tap(find.byKey(const Key('home-section-categories')));
await tester.pumpAndSettle();