feat(flutter): 榜单前三铺满与剧场分类吸顶下划线

This commit is contained in:
Zhou Weidong committed 2026-10-20 15:13:12 +08:00
1 parent d80fff74ba
commit 04a1a4ee82
4 files changed
+130 -52

No files matched your search

+22 -1
View File
@@ -226,6 +226,27 @@ void main() {
expect(header().color, AppColors.ink);
});
testWidgets('should_show_category_underline_for_selection', (tester) async {
await _pumpTheater(tester, categoryRepository: _GridCategoryRepository());
Color underline(String id) =>
(tester
.widget<Container>(
find.byKey(Key('theater-category-underline-$id')),
)
.decoration!
as BoxDecoration)
.color!;
expect(underline('all'), AppColors.blue);
expect(underline('7'), Colors.transparent);
await tester.tap(find.byKey(const Key('theater-category-7')));
await tester.pumpAndSettle();
expect(underline('all'), Colors.transparent);
expect(underline('7'), AppColors.blue);
});
testWidgets('should_use_compact_refresh_indicator', (tester) async {
await _pumpTheater(tester, categoryRepository: _GridCategoryRepository());
final indicator = tester.widget<RefreshIndicator>(
@@ -234,7 +255,7 @@ void main() {
expect(indicator.color, AppColors.blue);
expect(indicator.strokeWidth, 2);
expect(indicator.edgeOffset, 110);
expect(indicator.edgeOffset, 52);
});
}
+11 -3
View File
@@ -77,9 +77,10 @@ void main() {
final top1 = tester.getRect(find.byKey(const Key('ranking-cover-1')));
final top2 = tester.getRect(find.byKey(const Key('ranking-cover-2')));
final top3 = tester.getRect(find.byKey(const Key('ranking-cover-3')));
expect(top1.size, const Size(120, 160));
expect(top2.size, const Size(92, 124));
expect(top3.size, const Size(92, 124));
expect(top1.width, greaterThan(top2.width));
expect(top3.width, closeTo(top2.width, 0.5));
expect(top2.left, closeTo(14, 0.5));
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));
@@ -95,6 +96,13 @@ 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);
expect(
find.descendant(
of: find.byKey(const Key('ranking-row-3')),
matching: find.text('synopsis'),
),
findsOneWidget,
);
});
testWidgets('should_truncate_podium_when_less_than_three', (tester) async {