feat: UI 清新风全面改造 — 朝露主题 + shadcn_ui + 全局字号放大
- 全新"朝露"主题:深青绿主色(#2D6A4F),暖白底,完整设计Token - 引入 shadcn_ui 组件库,MaterialApp 注入 ShadTheme - 新增 4 个公共组件:AppCard、AppMenuItem、AppEmptyState、AppTabChip - 全面消除硬编码颜色,统一使用 AppTheme Token - 全局字号 +3~4pt,图标等比放大 +3px - home/medication/profile/settings/login 等核心页面重写 - 路由和功能逻辑零改动
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../core/app_theme.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '../../core/navigation_provider.dart';
|
||||
import 'report_pages.dart';
|
||||
@@ -31,12 +32,12 @@ class _AiAnalysisPageState extends ConsumerState<AiAnalysisPage> {
|
||||
if (analysis == null) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text('AI 解读')),
|
||||
body: const Center(child: CircularProgressIndicator(color: Color(0xFF8B9CF7))),
|
||||
body: const Center(child: CircularProgressIndicator(color: AppTheme.primary)),
|
||||
);
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFFF8F9FC),
|
||||
backgroundColor: AppTheme.bg,
|
||||
appBar: AppBar(
|
||||
title: const Text('AI 智能解读'),
|
||||
leading: IconButton(
|
||||
@@ -74,15 +75,15 @@ class _AiAnalysisPageState extends ConsumerState<AiAnalysisPage> {
|
||||
return Container(
|
||||
width: double.infinity, padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: [BoxShadow(color: const Color(0xFF8B9CF7).withAlpha(10), blurRadius: 8)]),
|
||||
boxShadow: [BoxShadow(color: AppTheme.primary.withAlpha(10), blurRadius: 8)]),
|
||||
child: Row(children: [
|
||||
Container(width: 48, height: 48, decoration: BoxDecoration(color: const Color(0xFFF0F2FF), borderRadius: BorderRadius.circular(12)),
|
||||
child: const Icon(Icons.auto_awesome, size: 24, color: Color(0xFF8B9CF7))),
|
||||
Container(width: 48, height: 48, decoration: BoxDecoration(color: AppTheme.primaryLight, borderRadius: BorderRadius.circular(12)),
|
||||
child: const Icon(Icons.auto_awesome, size: 28, color: AppTheme.primary)),
|
||||
const SizedBox(width: 14),
|
||||
Expanded(child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
Text(analysis.reportType, style: const TextStyle(fontSize: 18, fontWeight: FontWeight.w700)),
|
||||
Text(analysis.reportType, style: const TextStyle(fontSize: 21, fontWeight: FontWeight.w700)),
|
||||
const SizedBox(height: 4),
|
||||
const Text('AI 预解读结果 · 待医生确认', style: TextStyle(fontSize: 13, color: Color(0xFF999999))),
|
||||
const Text('AI 预解读结果 · 待医生确认', style: TextStyle(fontSize: 16, color: Color(0xFF999999))),
|
||||
])),
|
||||
]),
|
||||
);
|
||||
@@ -97,12 +98,12 @@ class _AiAnalysisPageState extends ConsumerState<AiAnalysisPage> {
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Row(mainAxisSize: MainAxisSize.min, children: [
|
||||
Icon(isReviewed ? Icons.check_circle : Icons.hourglass_empty, size: 18,
|
||||
color: isReviewed ? const Color(0xFF43A047) : const Color(0xFFF59E0B)),
|
||||
Icon(isReviewed ? Icons.check_circle : Icons.hourglass_empty, size: 21,
|
||||
color: isReviewed ? AppTheme.success : const Color(0xFFF59E0B)),
|
||||
const SizedBox(width: 8),
|
||||
Text(isReviewed ? '已通过医生审核' : '等待医生审核中',
|
||||
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500,
|
||||
color: isReviewed ? const Color(0xFF43A047) : const Color(0xFFF59E0B))),
|
||||
style: TextStyle(fontSize: 17, fontWeight: FontWeight.w500,
|
||||
color: isReviewed ? AppTheme.success : const Color(0xFFF59E0B))),
|
||||
]),
|
||||
);
|
||||
}
|
||||
@@ -114,7 +115,7 @@ class _AiAnalysisPageState extends ConsumerState<AiAnalysisPage> {
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
const Padding(
|
||||
padding: EdgeInsets.fromLTRB(16, 16, 16, 8),
|
||||
child: Text('指标分析', style: TextStyle(fontSize: 16, fontWeight: FontWeight.w700)),
|
||||
child: Text('指标分析', style: TextStyle(fontSize: 19, fontWeight: FontWeight.w700)),
|
||||
),
|
||||
...analysis.indicators.map((ind) => _buildIndicatorRow(ind)),
|
||||
const SizedBox(height: 8),
|
||||
@@ -126,9 +127,9 @@ class _AiAnalysisPageState extends ConsumerState<AiAnalysisPage> {
|
||||
final Color color;
|
||||
final IconData icon;
|
||||
switch (ind.status) {
|
||||
case 'high': color = const Color(0xFFE53935); icon = Icons.arrow_upward; break;
|
||||
case 'high': color = AppTheme.error; icon = Icons.arrow_upward; break;
|
||||
case 'low': color = const Color(0xFFF9A825); icon = Icons.arrow_downward; break;
|
||||
default: color = const Color(0xFF43A047); icon = Icons.check_circle;
|
||||
default: color = AppTheme.success; icon = Icons.check_circle;
|
||||
}
|
||||
return Container(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 16),
|
||||
@@ -137,15 +138,15 @@ class _AiAnalysisPageState extends ConsumerState<AiAnalysisPage> {
|
||||
child: Row(children: [
|
||||
Expanded(
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
Text(ind.name, style: const TextStyle(fontSize: 15, fontWeight: FontWeight.w500)),
|
||||
Text(ind.name, style: const TextStyle(fontSize: 18, fontWeight: FontWeight.w500)),
|
||||
if (ind.referenceRange != null && ind.referenceRange!.isNotEmpty)
|
||||
Text('参考值: ${ind.referenceRange}', style: const TextStyle(fontSize: 12, color: Color(0xFF999999))),
|
||||
Text('参考值: ${ind.referenceRange}', style: const TextStyle(fontSize: 15, color: Color(0xFF999999))),
|
||||
]),
|
||||
),
|
||||
Column(crossAxisAlignment: CrossAxisAlignment.end, children: [
|
||||
Text('${ind.value} ${ind.unit}',
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: color)),
|
||||
Icon(icon, size: 14, color: color),
|
||||
style: TextStyle(fontSize: 19, fontWeight: FontWeight.w600, color: color)),
|
||||
Icon(icon, size: 17, color: color),
|
||||
]),
|
||||
]),
|
||||
);
|
||||
@@ -158,19 +159,19 @@ class _AiAnalysisPageState extends ConsumerState<AiAnalysisPage> {
|
||||
border: Border.all(color: const Color(0xFFFDE68A))),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
const Row(children: [
|
||||
Text('💡', style: TextStyle(fontSize: 18)),
|
||||
Text('💡', style: TextStyle(fontSize: 21)),
|
||||
SizedBox(width: 8),
|
||||
Text('综合解读', style: TextStyle(fontSize: 16, fontWeight: FontWeight.w700, color: Color(0xFFD97706))),
|
||||
Text('综合解读', style: TextStyle(fontSize: 19, fontWeight: FontWeight.w700, color: Color(0xFFD97706))),
|
||||
]),
|
||||
const SizedBox(height: 10),
|
||||
Text(analysis.summary.isNotEmpty ? analysis.summary : '暂无 AI 解读结果',
|
||||
style: const TextStyle(fontSize: 14, color: Color(0xFF92400E), height: 1.6)),
|
||||
style: const TextStyle(fontSize: 17, color: Color(0xFF92400E), height: 1.6)),
|
||||
const SizedBox(height: 10),
|
||||
Container(
|
||||
width: double.infinity, padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10)),
|
||||
child: const Text('⚠️ AI 解读仅供参考,请以医生诊断为准',
|
||||
style: TextStyle(fontSize: 12, color: Color(0xFFD97706))),
|
||||
style: TextStyle(fontSize: 15, color: Color(0xFFD97706))),
|
||||
),
|
||||
]),
|
||||
);
|
||||
@@ -183,18 +184,18 @@ class _AiAnalysisPageState extends ConsumerState<AiAnalysisPage> {
|
||||
border: Border.all(color: const Color(0xFF86EFAC))),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
const Row(children: [
|
||||
Text('✅', style: TextStyle(fontSize: 18)),
|
||||
Text('✅', style: TextStyle(fontSize: 21)),
|
||||
SizedBox(width: 8),
|
||||
Text('医生审核意见', style: TextStyle(fontSize: 16, fontWeight: FontWeight.w700, color: Color(0xFF2E7D32))),
|
||||
Text('医生审核意见', style: TextStyle(fontSize: 19, fontWeight: FontWeight.w700, color: Color(0xFF2E7D32))),
|
||||
]),
|
||||
if (report.doctorName != null) ...[
|
||||
const SizedBox(height: 4),
|
||||
Text('审核医生:${report.doctorName}', style: const TextStyle(fontSize: 13, color: Color(0xFF4CAF50))),
|
||||
Text('审核医生:${report.doctorName}', style: const TextStyle(fontSize: 16, color: Color(0xFF4CAF50))),
|
||||
],
|
||||
if (report.reviewedAt != null) ...[
|
||||
const SizedBox(height: 2),
|
||||
Text('审核时间:${report.reviewedAt!.toLocal().toString().substring(0, 16)}',
|
||||
style: const TextStyle(fontSize: 12, color: Color(0xFF81C784))),
|
||||
style: const TextStyle(fontSize: 15, color: Color(0xFF81C784))),
|
||||
],
|
||||
if (report.severity != null) ...[
|
||||
const SizedBox(height: 8),
|
||||
@@ -206,7 +207,7 @@ class _AiAnalysisPageState extends ConsumerState<AiAnalysisPage> {
|
||||
width: double.infinity, padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10)),
|
||||
child: Text('💬 ${report.doctorComment!}',
|
||||
style: const TextStyle(fontSize: 15, color: Color(0xFF1A1A1A), height: 1.5)),
|
||||
style: const TextStyle(fontSize: 18, color: Color(0xFF1A1A1A), height: 1.5)),
|
||||
),
|
||||
],
|
||||
if (report.doctorRecommendation != null && report.doctorRecommendation!.isNotEmpty) ...[
|
||||
@@ -215,7 +216,7 @@ class _AiAnalysisPageState extends ConsumerState<AiAnalysisPage> {
|
||||
width: double.infinity, padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10)),
|
||||
child: Text('📝 ${report.doctorRecommendation!}',
|
||||
style: const TextStyle(fontSize: 14, color: Color(0xFF333333), height: 1.5)),
|
||||
style: const TextStyle(fontSize: 17, color: Color(0xFF333333), height: 1.5)),
|
||||
),
|
||||
],
|
||||
]),
|
||||
@@ -224,7 +225,7 @@ class _AiAnalysisPageState extends ConsumerState<AiAnalysisPage> {
|
||||
|
||||
Widget _severityBadge(String severity) {
|
||||
final (label, color, bg) = switch (severity) {
|
||||
'Normal' => ('🟢 正常', const Color(0xFF43A047), const Color(0xFFDCFCE7)),
|
||||
'Normal' => ('🟢 正常', AppTheme.success, const Color(0xFFDCFCE7)),
|
||||
'Abnormal' => ('🟡 轻度异常', const Color(0xFFF59E0B), const Color(0xFFFFF3E0)),
|
||||
'Severe' => ('🟠 中度异常', const Color(0xFFFF7043), const Color(0xFFFEE2E2)),
|
||||
'Critical' => ('🔴 重度异常', const Color(0xFFDC2626), const Color(0xFFFEE2E2)),
|
||||
@@ -233,7 +234,7 @@ class _AiAnalysisPageState extends ConsumerState<AiAnalysisPage> {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
|
||||
decoration: BoxDecoration(color: bg, borderRadius: BorderRadius.circular(6)),
|
||||
child: Text(label, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w500, color: color)),
|
||||
child: Text(label, style: TextStyle(fontSize: 15, fontWeight: FontWeight.w500, color: color)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user