style: 全项目紫色→薄荷绿 Fresh Air 清新风
- 主色 #635BFF→#14B8A6 (薄荷绿) - 浅紫 #EDEBFF→#E6FAF6 (极浅薄荷) - 深紫 #4B44D6→#0F9D8E (深薄荷) - 渐变紫→薄荷渐变 - 全局13种紫色映射替换
This commit is contained in:
@@ -1,33 +1,28 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// 健康管家主题 —— 暖茶绿 · Soft Clinical
|
||||
/// 深青碧色主调 + 暖白基底 + 琥珀点缀 避开传统医疗蓝/紫
|
||||
/// 健康管家 — Fresh Air 清新风
|
||||
/// 薄荷绿主调 · 轻透白底 · 珊瑚点缀
|
||||
class AppTheme {
|
||||
AppTheme._();
|
||||
|
||||
// ── 品牌色 ──
|
||||
static const Color primary = Color(0xFF0E8C7D); // 深青碧 · 专业信赖
|
||||
static const Color primaryLight = Color(0xFFE3F4F0); // 浅青底
|
||||
static const Color primaryDark = Color(0xFF0A6B5F); // 深青
|
||||
static const Color primary = Color(0xFF14B8A6); // 薄荷绿
|
||||
static const Color primaryLight = Color(0xFFE6FAF6); // 极浅薄荷
|
||||
static const Color primaryDark = Color(0xFF0F9D8E); // 深薄荷
|
||||
|
||||
// ── 背景 ──
|
||||
static const Color bg = Color(0xFFFAF6F1); // 暖白 · 不冰冷
|
||||
static const Color surface = Color(0xFFFFFCF9); // 卡片白
|
||||
static const Color bg = Color(0xFFF6F9FB); // 清透底
|
||||
static const Color surface = Color(0xFFFFFFFF); // 卡片白
|
||||
|
||||
// ── 文字 ──
|
||||
static const Color text = Color(0xFF2D2B32);
|
||||
static const Color textSub = Color(0xFF7B797F);
|
||||
static const Color textHint = Color(0xFFB0ADB5);
|
||||
static const Color text = Color(0xFF1C2B33);
|
||||
static const Color textSub = Color(0xFF6B7C85);
|
||||
static const Color textHint = Color(0xFFA5B4BD);
|
||||
|
||||
// ── 功能色 ──
|
||||
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 success = Color(0xFF10B981);
|
||||
static const Color error = Color(0xFFF56C6C);
|
||||
static const Color warning = Color(0xFFF59E0B);
|
||||
static const Color accent = Color(0xFFFF7B6B); // 珊瑚
|
||||
|
||||
// ── 边框 & 分割 ──
|
||||
static const Color border = Color(0xFFE8E4DF);
|
||||
static const Color divider = Color(0xFFF0ECE7);
|
||||
static const Color border = Color(0xFFE5EBF0);
|
||||
static const Color divider = Color(0xFFEEF2F6);
|
||||
|
||||
static ThemeData get lightTheme => ThemeData(
|
||||
useMaterial3: true,
|
||||
@@ -39,77 +34,54 @@ class AppTheme {
|
||||
),
|
||||
scaffoldBackgroundColor: bg,
|
||||
|
||||
// AppBar
|
||||
appBarTheme: const AppBarTheme(
|
||||
backgroundColor: surface,
|
||||
foregroundColor: text,
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
titleTextStyle: TextStyle(fontSize: 18, fontWeight: FontWeight.w600, color: text),
|
||||
scrolledUnderElevation: 0,
|
||||
),
|
||||
|
||||
// 卡片
|
||||
cardTheme: CardThemeData(
|
||||
color: surface,
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(18)),
|
||||
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 6),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
||||
margin: EdgeInsets.zero,
|
||||
),
|
||||
|
||||
// 输入框
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
filled: true,
|
||||
fillColor: surface,
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
borderSide: const BorderSide(color: border),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
borderSide: const BorderSide(color: border),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
borderSide: const BorderSide(color: primary, width: 1.5),
|
||||
),
|
||||
fillColor: const Color(0xFFF2F6F9),
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 14, vertical: 12),
|
||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12), borderSide: BorderSide.none),
|
||||
enabledBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(12), borderSide: BorderSide.none),
|
||||
focusedBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(12), borderSide: const BorderSide(color: primary, width: 1.5)),
|
||||
hintStyle: const TextStyle(color: textHint, fontSize: 15),
|
||||
),
|
||||
|
||||
// 按钮
|
||||
elevatedButtonTheme: ElevatedButtonThemeData(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: primary,
|
||||
foregroundColor: Colors.white,
|
||||
minimumSize: const Size(double.infinity, 50),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(26)),
|
||||
textStyle: const TextStyle(fontSize: 17, fontWeight: FontWeight.w600),
|
||||
minimumSize: const Size(double.infinity, 48),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)),
|
||||
textStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
|
||||
elevation: 0,
|
||||
),
|
||||
),
|
||||
|
||||
// 圆角 Dialog
|
||||
dialogTheme: DialogThemeData(
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(24)),
|
||||
backgroundColor: surface,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(22)),
|
||||
),
|
||||
|
||||
// 总体圆角
|
||||
chipTheme: ChipThemeData(
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
|
||||
backgroundColor: primaryLight,
|
||||
),
|
||||
|
||||
// 字体层级
|
||||
textTheme: const TextTheme(
|
||||
headlineLarge: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: text, letterSpacing: -0.5),
|
||||
headlineLarge: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: text),
|
||||
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),
|
||||
bodyLarge: TextStyle(fontSize: 16, color: text, height: 1.5),
|
||||
bodyMedium: TextStyle(fontSize: 15, color: textSub, height: 1.4),
|
||||
labelMedium: TextStyle(fontSize: 13, color: textSub),
|
||||
labelSmall: TextStyle(fontSize: 11, color: textHint),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user