From f484c6b66a48188d5d3b0b49ad7151bd467cb1a9 Mon Sep 17 00:00:00 2001 From: MingNian <1281442923@qq.com> Date: Wed, 3 Jun 2026 20:28:39 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E4=B8=BB=E9=A2=98=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=20=E2=80=94=20=E6=9A=96=E8=8C=B6=E7=BB=BF=20Soft=20Clinical?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 主色: 深青碧 #0E8C7D(专业信赖) - 背景: 暖白 #FAF6F1(不再冰冷) - 高亮: 琥珀 #F0984A(温暖人性) - 全局圆角统一 14-26px - 字体层级优化 --- health_app/lib/core/app_theme.dart | 120 +++++++++++++++++++---------- 1 file changed, 79 insertions(+), 41 deletions(-) diff --git a/health_app/lib/core/app_theme.dart b/health_app/lib/core/app_theme.dart index b281a79..e923b91 100644 --- a/health_app/lib/core/app_theme.dart +++ b/health_app/lib/core/app_theme.dart @@ -1,77 +1,115 @@ import 'package:flutter/material.dart'; -/// 健康管家主题配置——薰衣草紫 + 温暖治愈风 +/// 健康管家主题 —— 暖茶绿 · Soft Clinical +/// 深青碧色主调 + 暖白基底 + 琥珀点缀 避开传统医疗蓝/紫 class AppTheme { AppTheme._(); - static const Color primaryColor = Color(0xFF635BFF); - static const Color primaryLight = Color(0xFFEDEBFF); - static const Color primaryDark = Color(0xFF4B44D6); - static const Color background = Color(0xFFF8F9FF); - static const Color cardWhite = Color(0xFFFFFFFF); - static const Color textPrimary = Color(0xFF1A1A1A); - static const Color textSecondary = Color(0xFF666666); - static const Color textPlaceholder = Color(0xFF999999); - static const Color successGreen = Color(0xFF43A047); - static const Color errorRed = Color(0xFFE53935); - static const Color warningYellow = Color(0xFFF9A825); - static const Color secondaryButton = Color(0xFFE5E5F7); + // ── 品牌色 ── + static const Color primary = Color(0xFF0E8C7D); // 深青碧 · 专业信赖 + static const Color primaryLight = Color(0xFFE3F4F0); // 浅青底 + static const Color primaryDark = Color(0xFF0A6B5F); // 深青 + + // ── 背景 ── + static const Color bg = Color(0xFFFAF6F1); // 暖白 · 不冰冷 + static const Color surface = Color(0xFFFFFCF9); // 卡片白 + + // ── 文字 ── + static const Color text = Color(0xFF2D2B32); + static const Color textSub = Color(0xFF7B797F); + static const Color textHint = Color(0xFFB0ADB5); + + // ── 功能色 ── + static const Color success = Color(0xFF43A047); + static const Color error = Color(0xFFE05D5D); + static const Color warning = Color(0xFFF0984A); + static const Color accent = Color(0xFFF0984A); // 琥珀 · 高亮/操作 + + // ── 边框 & 分割 ── + static const Color border = Color(0xFFE8E4DF); + static const Color divider = Color(0xFFF0ECE7); static ThemeData get lightTheme => ThemeData( useMaterial3: true, colorScheme: ColorScheme.fromSeed( - seedColor: primaryColor, - primary: primaryColor, - surface: background, + seedColor: primary, + primary: primary, + surface: bg, brightness: Brightness.light, ), - scaffoldBackgroundColor: background, + scaffoldBackgroundColor: bg, + + // AppBar appBarTheme: const AppBarTheme( - backgroundColor: cardWhite, - foregroundColor: textPrimary, + backgroundColor: surface, + foregroundColor: text, elevation: 0, centerTitle: true, + titleTextStyle: TextStyle(fontSize: 18, fontWeight: FontWeight.w600, color: text), ), + + // 卡片 cardTheme: CardThemeData( - color: cardWhite, + color: surface, elevation: 0, - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), - margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(18)), + margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 6), ), + + // 输入框 inputDecorationTheme: InputDecorationTheme( filled: true, - fillColor: cardWhite, - contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), + fillColor: surface, + contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14), border: OutlineInputBorder( - borderRadius: BorderRadius.circular(12), - borderSide: const BorderSide(color: secondaryButton, width: 1.5), + borderRadius: BorderRadius.circular(14), + borderSide: const BorderSide(color: border), ), enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(12), - borderSide: const BorderSide(color: secondaryButton, width: 1.5), + borderRadius: BorderRadius.circular(14), + borderSide: const BorderSide(color: border), ), focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(12), - borderSide: const BorderSide(color: primaryColor, width: 1.5), + borderRadius: BorderRadius.circular(14), + borderSide: const BorderSide(color: primary, width: 1.5), ), - hintStyle: const TextStyle(color: textPlaceholder, fontSize: 16), + hintStyle: const TextStyle(color: textHint, fontSize: 15), ), + + // 按钮 elevatedButtonTheme: ElevatedButtonThemeData( style: ElevatedButton.styleFrom( - backgroundColor: primaryColor, + backgroundColor: primary, foregroundColor: Colors.white, - minimumSize: const Size(double.infinity, 48), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(24)), - textStyle: const TextStyle(fontSize: 18, fontWeight: FontWeight.w600), + minimumSize: const Size(double.infinity, 50), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(26)), + textStyle: const TextStyle(fontSize: 17, fontWeight: FontWeight.w600), + elevation: 0, ), ), + + // 圆角 Dialog + dialogTheme: DialogThemeData( + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(24)), + backgroundColor: surface, + ), + + // 总体圆角 + chipTheme: ChipThemeData( + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), + backgroundColor: primaryLight, + ), + + // 字体层级 textTheme: const TextTheme( - headlineLarge: TextStyle(fontSize: 24, fontWeight: FontWeight.w600, color: textPrimary), - titleLarge: TextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: textPrimary), - bodyLarge: TextStyle(fontSize: 18, fontWeight: FontWeight.w400, color: textPrimary), - bodyMedium: TextStyle(fontSize: 16, fontWeight: FontWeight.w400, color: textSecondary), - labelMedium: TextStyle(fontSize: 14, fontWeight: FontWeight.w400, color: textSecondary), - labelSmall: TextStyle(fontSize: 12, fontWeight: FontWeight.w400, color: textSecondary), + headlineLarge: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: text, letterSpacing: -0.5), + titleLarge: TextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: text), + titleMedium: TextStyle(fontSize: 18, fontWeight: FontWeight.w600, color: text), + bodyLarge: TextStyle(fontSize: 16, fontWeight: FontWeight.w400, color: text, height: 1.5), + bodyMedium: TextStyle(fontSize: 15, fontWeight: FontWeight.w400, color: textSub, height: 1.4), + labelLarge: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: textSub), + labelMedium: TextStyle(fontSize: 13, fontWeight: FontWeight.w400, color: textSub), + labelSmall: TextStyle(fontSize: 11, fontWeight: FontWeight.w400, color: textHint), ), ); }