Files
AI-Health/health_app/lib/core/app_theme.dart
MingNian f6c1ea7ec9 style: 淡薰紫 Lavender Breeze + UI修复
- 主色改淡薰紫 #8B9CF7 + 白底 清新风格
- 每个智能体卡不同淡色调
- 删除欢迎卡底部"或直接对我说"
- 运动创建/打卡接入 API
- 全项目薄荷绿→淡紫替换
2026-06-03 20:46:39 +08:00

82 lines
3.8 KiB
Dart

import 'package:flutter/material.dart';
/// 健康管家 — Lavender Breeze 淡紫清风
class AppTheme {
AppTheme._();
static const Color primary = Color(0xFF8B9CF7); // 淡薰紫
static const Color primaryLight = Color(0xFFF0F2FF); // 极淡紫底
static const Color primaryDark = Color(0xFF6A7DE0); // 深薰紫
static const Color bg = Color(0xFFF8F9FC); // 清透白底
static const Color surface = Color(0xFFFFFFFF); // 纯白卡片
static const Color text = Color(0xFF2D2B32);
static const Color textSub = Color(0xFF8A8892);
static const Color textHint = Color(0xFFBFBCC4);
static const Color success = Color(0xFF6ECF8A);
static const Color error = Color(0xFFF56C6C);
static const Color warning = Color(0xFFF5A623);
static const Color accent = Color(0xFFFF8068);
static const Color border = Color(0xFFEAEAF0);
static const Color divider = Color(0xFFF2F2F6);
/// 每个智能体的卡片色调
static const Map<String, Color> agentColors = {
'default': Color(0xFFE8ECFF), // 淡蓝紫
'consultation': Color(0xFFE8F5FF), // 淡天蓝
'health': Color(0xFFE8FFF0), // 淡薄荷
'diet': Color(0xFFFFF2E8), // 淡杏
'medication': Color(0xFFFFE8F0), // 淡粉
'report': Color(0xFFE8F4FF), // 淡水蓝
'exercise': Color(0xFFF0E8FF), // 淡紫
};
static Color agentLight(String? name) => agentColors[name] ?? primaryLight;
static ThemeData get lightTheme => ThemeData(
useMaterial3: true,
colorScheme: ColorScheme.fromSeed(seedColor: primary, primary: primary, surface: bg, brightness: Brightness.light),
scaffoldBackgroundColor: bg,
appBarTheme: const AppBarTheme(
backgroundColor: surface, foregroundColor: text, elevation: 0,
centerTitle: true, scrolledUnderElevation: 0,
titleTextStyle: TextStyle(fontSize: 17, fontWeight: FontWeight.w600, color: text),
),
cardTheme: CardThemeData(color: surface, elevation: 0,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), margin: EdgeInsets.zero),
inputDecorationTheme: InputDecorationTheme(
filled: true, fillColor: const Color(0xFFF4F5FA),
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, 48),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)),
textStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600), elevation: 0,
)),
dialogTheme: DialogThemeData(shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(22))),
textTheme: const TextTheme(
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, 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),
),
);
}