style: 统一全站深色视觉

This commit is contained in:
Zhou Weidong committed 2026-10-22 22:01:36 +08:00
1 parent 86aa7e0f4f
commit 37e35f4b47
24 files changed
+134 -130

No files matched your search

+4 -6
View File
@@ -28,7 +28,7 @@ void main() {
final title = tester.widget<Text>(find.byKey(const Key('subpage-title')));
expect(title.style?.fontSize, 18);
expect(title.style?.fontWeight, FontWeight.w800);
expect(title.style?.color, AppColors.onSurface);
expect(title.style?.color, AppColors.textPrimary);
final back = tester.getRect(find.byKey(const Key('sample-back')));
final titleRect = tester.getRect(find.byKey(const Key('subpage-title')));
expect(titleRect.left - back.right, closeTo(12, 0.5));
@@ -38,8 +38,8 @@ void main() {
matching: find.byType(Material),
),
);
expect(surface.color, AppColors.card);
expect((surface.shape! as CircleBorder).side.color, AppColors.border);
expect(surface.color, AppColors.transparent);
expect((surface.shape! as CircleBorder).side, BorderSide.none);
final shadow =
tester
.widget<DecoratedBox>(
@@ -47,9 +47,7 @@ void main() {
)
.decoration
as BoxDecoration;
expect(shadow.boxShadow!.single.color, AppColors.shadowSubtle);
expect(shadow.boxShadow!.single.blurRadius, 8);
expect(shadow.boxShadow!.single.offset, const Offset(0, 2));
expect(shadow.boxShadow, isEmpty);
});
testWidgets('should_use_64_height_when_subtitle_exists', (tester) async {
@@ -94,7 +94,8 @@ void main() {
);
final statsDecoration = stats.decoration! as BoxDecoration;
expect(statsDecoration.color, AppColors.card);
expect(statsDecoration.borderRadius, BorderRadius.circular(14));
expect(statsDecoration.borderRadius, BorderRadius.circular(12));
expect((statsDecoration.border! as Border).top.color, AppColors.border);
expect(find.byKey(const Key('detail-synopsis-section')), findsOneWidget);
expect(find.byKey(const Key('detail-tags')), findsOneWidget);
expect(find.byKey(const Key('detail-episodes-section')), findsOneWidget);
+16 -7
View File
@@ -20,11 +20,15 @@ void main() {
test('should_expose_dark_visual_tokens', () {
expect(AppColors.blue, const Color(0xFFFF6B2C));
expect(AppColors.bluePressed, const Color(0xFFE55A1F));
expect(AppColors.secondary, const Color(0xFF22D3EE));
expect(AppColors.ink, const Color(0xFF0B1020));
expect(AppColors.card, const Color(0xFF151B2E));
expect(AppColors.raised, const Color(0xFF1C2436));
expect(AppColors.border, const Color(0x0FFFFFFF));
expect(AppColors.secondary, const Color(0xFFB0B0B0));
expect(AppColors.ink, const Color(0xFF000000));
expect(AppColors.card, const Color(0xFF16161A));
expect(AppColors.cardAlt, const Color(0xFF101010));
expect(AppColors.raised, const Color(0xFF1C1C1E));
expect(AppColors.border, const Color(0xFF1C1C1E));
expect(AppColors.textPrimary, const Color(0xFFFFFFFF));
expect(AppColors.textSecondary, const Color(0xFFB0B0B0));
expect(AppColors.textTertiary, const Color(0xFF8E8E93));
expect(AppColors.onSurface, const Color(0xEBFFFFFF));
expect(AppColors.muted, const Color(0xA3FFFFFF));
expect(AppColors.subtle, const Color(0x61FFFFFF));
@@ -59,7 +63,7 @@ void main() {
expect(theme.colorScheme.onSurface, AppColors.onSurface);
expect(theme.colorScheme.outline, AppColors.border);
expect(theme.scaffoldBackgroundColor, AppColors.ink);
expect(theme.appBarTheme.backgroundColor, AppColors.card);
expect(theme.appBarTheme.backgroundColor, AppColors.transparent);
expect(theme.appBarTheme.systemOverlayStyle, SystemUiOverlayStyle.light);
expect(theme.cardTheme.elevation, 0);
expect(theme.dialogTheme.backgroundColor, AppColors.raised);
@@ -91,7 +95,12 @@ void main() {
});
test('should_expose_flat_page_gradient_without_card_shadow', () {
expect(AppTheme.pageGradient.colors, [AppColors.surfaceTop, AppColors.ink]);
expect(AppTheme.pageGradient.colors, [
AppColors.mineGradientTop,
AppColors.mineGradientMiddle,
AppColors.mineGradientBottom,
]);
expect(AppTheme.pageGradient.stops, [0, 0.4, 0.75]);
expect(AppTheme.cardShadow.color, AppColors.cardShadow);
expect(AppTheme.cardShadow.blurRadius, 0);
expect(AppTheme.cardShadow.offset, Offset.zero);
+1 -1
View File
@@ -65,7 +65,7 @@ void main() {
final theme = Theme.of(context);
expect(theme.brightness, Brightness.dark);
expect(theme.scaffoldBackgroundColor, AppColors.ink);
expect(theme.appBarTheme.backgroundColor, AppColors.card);
expect(theme.appBarTheme.backgroundColor, AppColors.transparent);
expect(theme.cardTheme.color, AppColors.card);
final card = tester.widget<Card>(find.byKey(const Key('dark-smoke-card')));