style(client): 对齐短剧列表字号与间距

This commit is contained in:
Zhou Weidong committed 2026-10-22 18:06:03 +08:00
1 parent d03dcf162e
commit d7a59e5a27
17 files changed
+576 -148

No files matched your search

@@ -6,6 +6,8 @@ import 'package:fruitshorts/app.dart';
import 'package:fruitshorts/core/data/repositories/favorite_repository.dart';
import 'package:fruitshorts/core/data/repositories/playback_repository.dart';
import 'package:fruitshorts/core/data/repositories/watch_history_repository.dart';
import 'package:fruitshorts/core/theme/app_colors.dart';
import 'package:fruitshorts/core/theme/app_dimens.dart';
import 'package:fruitshorts/core/widgets/app_bottom_nav.dart';
import 'package:fruitshorts/pages/player/player_view.dart';
import 'package:shared_preferences_platform_interface/in_memory_shared_preferences_async.dart';
@@ -66,6 +68,53 @@ void main() {
expect(find.text('New This Week'), findsOneWidget);
expect(find.text('Costume Drama Awards'), findsOneWidget);
expect(find.byType(AppBottomNav), findsOneWidget);
final sectionTitle = tester.widget<Text>(find.text("This Week's Hits"));
expect(sectionTitle.style?.fontSize, AppDimens.recommendSectionTitle);
expect(sectionTitle.style?.fontWeight, FontWeight.w700);
final sectionSubtitle = tester.widget<Text>(
find.text('Binge the hottest stories of the week!'),
);
expect(sectionSubtitle.style?.fontSize, AppDimens.recommendSectionSubtitle);
expect(sectionSubtitle.style?.color, AppColors.textSecondary);
final moreText = tester.widget<Text>(
find.descendant(
of: find.byKey(const Key('recommend-more-hits')),
matching: find.text('More'),
),
);
expect(moreText.style?.fontSize, AppDimens.recommendSectionMore);
expect(moreText.style?.color, AppColors.textSecondary);
final card = find.byKey(const Key('recommend-card-hits-the-signal-demo'));
final cover = tester.widget<AspectRatio>(
find.descendant(of: card, matching: find.byType(AspectRatio)),
);
expect(cover.aspectRatio, AppDimens.cardCoverAspectRatio);
final cardTitle = tester.widget<Text>(
find.byKey(const Key('recommend-title-hits-the-signal-demo')),
);
expect(cardTitle.style?.fontSize, AppDimens.cardTitleFont);
expect(cardTitle.style?.fontWeight, FontWeight.w500);
expect(cardTitle.style?.height, AppDimens.cardTitleLineHeight);
final views = tester.widget<Text>(
find.descendant(
of: find.byKey(const Key('recommend-views-hits-the-signal-demo')),
matching: find.byType(Text),
),
);
expect(views.style?.fontSize, AppDimens.cardViewsFont);
expect(views.style?.color, AppColors.textPrimary);
final tag = find.byKey(const Key('recommend-tag-hits-the-signal-demo-0'));
expect(tag, findsOneWidget);
expect(tester.getSize(tag).height, AppDimens.cardTagHeight);
final tagText = tester.widget<Text>(
find.descendant(of: tag, matching: find.byType(Text)),
);
expect(tagText.style?.fontSize, AppDimens.cardTagFont);
expect(tagText.style?.color, AppColors.textTertiary);
expect(
(tester.widget<Container>(tag).decoration! as BoxDecoration).borderRadius,
BorderRadius.circular(AppDimens.cardTagRadius),
);
});
testWidgets('should_switch_inner_tabs_without_losing_grid_filter_state', (
@@ -88,6 +137,21 @@ void main() {
await tester.tap(find.byKey(const Key('all-sort-new')));
await tester.pump();
expect(_textStyle(tester, 'New').fontWeight, FontWeight.w700);
expect(_textStyle(tester, 'New').fontSize, AppDimens.filterChipFont);
expect(
tester.getSize(find.byKey(const Key('all-sort-new'))).height,
AppDimens.filterChipHeight,
);
final chipContainer = tester.widget<Container>(
find.descendant(
of: find.byKey(const Key('all-sort-new')),
matching: find.byType(Container),
),
);
expect(
(chipContainer.decoration! as BoxDecoration).borderRadius,
BorderRadius.circular(AppDimens.filterChipRadius),
);
await tester.tap(find.byKey(const Key('recommend-tab-playlist')));
await tester.pumpAndSettle();