feat(Core UI): 白天黑夜模式

This commit is contained in:
DK
2026-03-09 16:48:07 +08:00
parent 59a866e540
commit 68a43b3613
2 changed files with 12 additions and 14 deletions

View File

@@ -41,17 +41,4 @@ class AppColors {
// ── Neutral black Scale ───────────────────────────────────────────────────── // ── Neutral black Scale ─────────────────────────────────────────────────────
static const black12 = Color(0x1F000000); // 12% opacity static const black12 = Color(0x1F000000); // 12% opacity
static const black60 = Color(0x99000000); // 60% opacity static const black60 = Color(0x99000000); // 60% opacity
/// 阴影颜色 Token
static Color shadow(BuildContext context) {
final brightness = Theme
.of(context)
.brightness;
if (brightness == Brightness.dark) {
return black60;
}
return black12;
}
} }

View File

@@ -60,7 +60,7 @@ class AppShadows {
BoxShadow( BoxShadow(
/// 阴影颜色来自 Design Token /// 阴影颜色来自 Design Token
color: AppColors.shadow(context), color: _shadowColor,
/// 模糊半径(影响阴影扩散范围) /// 模糊半径(影响阴影扩散范围)
blurRadius: blur, blurRadius: blur,
@@ -115,4 +115,15 @@ class AppShadows {
blur: 16, blur: 16,
dy: 8, dy: 8,
); );
/// 阴影颜色 Token
Color get _shadowColor {
final brightness = Theme
.of(context)
.brightness;
return brightness == Brightness.dark
? AppColors.black60
: AppColors.black12;
}
} }