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:
@@ -5,6 +5,8 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
import '../../core/app_theme.dart';
|
||||
import '../../core/navigation_provider.dart';
|
||||
import '../../providers/auth_provider.dart';
|
||||
|
||||
@@ -222,7 +224,7 @@ class ReportListPage extends ConsumerWidget {
|
||||
appBar: AppBar(title: const Text('看报告')),
|
||||
body: const Center(
|
||||
child: Column(mainAxisSize: MainAxisSize.min, children: [
|
||||
CircularProgressIndicator(color: Color(0xFF8B9CF7)),
|
||||
CircularProgressIndicator(color: AppTheme.primaryLight),
|
||||
SizedBox(height: 16),
|
||||
Text('AI 正在分析报告...'),
|
||||
]),
|
||||
@@ -252,7 +254,7 @@ class ReportListPage extends ConsumerWidget {
|
||||
Widget _buildUploadButton(BuildContext context, WidgetRef ref) {
|
||||
return FloatingActionButton(
|
||||
onPressed: () => _showUploadOptions(context, ref),
|
||||
backgroundColor: const Color(0xFF8B9CF7),
|
||||
backgroundColor: AppTheme.primary,
|
||||
child: const Icon(Icons.add),
|
||||
);
|
||||
}
|
||||
@@ -312,12 +314,12 @@ class ReportListPage extends ConsumerWidget {
|
||||
color: const Color(0xFFF0F2FF),
|
||||
borderRadius: BorderRadius.circular(60),
|
||||
),
|
||||
child: const Icon(Icons.file_open, size: 48, color: Color(0xFF8B9CF7)),
|
||||
child: const Icon(Icons.file_open, size: 48, color: AppTheme.primaryLight),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
const Text('暂无检查报告', style: TextStyle(fontSize: 18, fontWeight: FontWeight.w500)),
|
||||
const Text('暂无检查报告', style: TextStyle(fontSize: 21, fontWeight: FontWeight.w500)),
|
||||
const SizedBox(height: 8),
|
||||
const Text('点击下方按钮上传报告', style: TextStyle(fontSize: 14, color: Color(0xFF999999))),
|
||||
const Text('点击下方按钮上传报告', style: TextStyle(fontSize: 17, color: Color(0xFF999999))),
|
||||
]),
|
||||
);
|
||||
}
|
||||
@@ -328,7 +330,7 @@ class ReportListPage extends ConsumerWidget {
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: [BoxShadow(color: const Color(0xFF8B9CF7).withAlpha(10), blurRadius: 4, offset: const Offset(0, 2))],
|
||||
boxShadow: [BoxShadow(color: AppTheme.primary.withAlpha(10), blurRadius: 4, offset: const Offset(0, 2))],
|
||||
),
|
||||
child: ListTile(
|
||||
leading: Container(
|
||||
@@ -340,10 +342,10 @@ class ReportListPage extends ConsumerWidget {
|
||||
),
|
||||
child: _getReportIcon(report.type),
|
||||
),
|
||||
title: Text(report.title, style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600)),
|
||||
title: Text(report.title, style: const TextStyle(fontSize: 19, fontWeight: FontWeight.w600)),
|
||||
subtitle: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
Text(report.type, style: TextStyle(fontSize: 14, color: Colors.grey[500])),
|
||||
Text(_formatDate(report.uploadedAt), style: TextStyle(fontSize: 12, color: Colors.grey[400])),
|
||||
Text(report.type, style: TextStyle(fontSize: 17, color: Colors.grey[500])),
|
||||
Text(_formatDate(report.uploadedAt), style: TextStyle(fontSize: 15, color: Colors.grey[400])),
|
||||
]),
|
||||
trailing: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
@@ -355,7 +357,7 @@ class ReportListPage extends ConsumerWidget {
|
||||
color: const Color(0xFFDCFCE7),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: const Text('已审核', style: TextStyle(fontSize: 10, color: Color(0xFF43A047))),
|
||||
child: const Text('已审核', style: TextStyle(fontSize: 13, color: Color(0xFF43A047))),
|
||||
)
|
||||
else if (!report.hasAnalysis)
|
||||
Container(
|
||||
@@ -364,7 +366,7 @@ class ReportListPage extends ConsumerWidget {
|
||||
color: const Color(0xFFE3F2FD),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: const Text('分析中', style: TextStyle(fontSize: 10, color: Color(0xFF2196F3))),
|
||||
child: const Text('分析中', style: TextStyle(fontSize: 13, color: Color(0xFF2196F3))),
|
||||
)
|
||||
else if (report.status == 'PendingDoctor')
|
||||
Container(
|
||||
@@ -373,12 +375,12 @@ class ReportListPage extends ConsumerWidget {
|
||||
color: const Color(0xFFFFF3E0),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: const Text('待审核', style: TextStyle(fontSize: 10, color: Color(0xFFF59E0B))),
|
||||
child: const Text('待审核', style: TextStyle(fontSize: 13, color: Color(0xFFF59E0B))),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
report.hasAnalysis
|
||||
? const Icon(Icons.check_circle, size: 20, color: Color(0xFF43A047))
|
||||
: const Icon(Icons.arrow_forward_ios, size: 18, color: Color(0xFFCCCCCC)),
|
||||
? const Icon(Icons.check_circle, size: 23, color: Color(0xFF43A047))
|
||||
: const Icon(Icons.arrow_forward_ios, size: 21, color: Color(0xFFCCCCCC)),
|
||||
],
|
||||
),
|
||||
onTap: () {
|
||||
@@ -390,13 +392,13 @@ class ReportListPage extends ConsumerWidget {
|
||||
|
||||
Widget _getReportIcon(String type) {
|
||||
final icons = {
|
||||
'血液检查': const Icon(Icons.bloodtype, size: 24, color: Color(0xFF8B9CF7)),
|
||||
'心电图': const Icon(Icons.monitor_heart, size: 24, color: Color(0xFF8B9CF7)),
|
||||
'超声检查': const Icon(Icons.image, size: 24, color: Color(0xFF8B9CF7)),
|
||||
'影像报告': const Icon(Icons.image, size: 24, color: Color(0xFF8B9CF7)),
|
||||
'PDF文档': const Icon(Icons.picture_as_pdf, size: 24, color: Color(0xFF8B9CF7)),
|
||||
'血液检查': const Icon(Icons.bloodtype, size: 28, color: AppTheme.primaryLight),
|
||||
'心电图': const Icon(Icons.monitor_heart, size: 28, color: AppTheme.primaryLight),
|
||||
'超声检查': const Icon(Icons.image, size: 28, color: AppTheme.primaryLight),
|
||||
'影像报告': const Icon(Icons.image, size: 28, color: AppTheme.primaryLight),
|
||||
'PDF文档': const Icon(Icons.picture_as_pdf, size: 28, color: AppTheme.primaryLight),
|
||||
};
|
||||
return icons[type] ?? const Icon(Icons.description, size: 24, color: Color(0xFF8B9CF7));
|
||||
return icons[type] ?? const Icon(Icons.description, size: 28, color: AppTheme.primaryLight);
|
||||
}
|
||||
|
||||
String _formatDate(DateTime date) {
|
||||
@@ -438,7 +440,7 @@ class _ReportDetailPageState extends ConsumerState<ReportDetailPage> {
|
||||
if (analysis == null) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text('报告详情')),
|
||||
body: const Center(child: CircularProgressIndicator(color: Color(0xFF8B9CF7))),
|
||||
body: const Center(child: CircularProgressIndicator(color: AppTheme.primaryLight)),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -470,7 +472,7 @@ class _ReportDetailPageState extends ConsumerState<ReportDetailPage> {
|
||||
width: double.infinity, height: 48,
|
||||
child: ElevatedButton(
|
||||
onPressed: () => pushRoute(ref, 'aiAnalysis', params: {'id': widget.id}),
|
||||
style: ElevatedButton.styleFrom(backgroundColor: const Color(0xFF8B9CF7), foregroundColor: Colors.white,
|
||||
style: ElevatedButton.styleFrom(backgroundColor: AppTheme.primary, foregroundColor: Colors.white,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(24))),
|
||||
child: const Text('查看 AI 智能解读'),
|
||||
),
|
||||
@@ -491,17 +493,17 @@ class _ReportDetailPageState extends ConsumerState<ReportDetailPage> {
|
||||
),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
Row(children: [
|
||||
const Text('✅', style: TextStyle(fontSize: 20)),
|
||||
const Text('✅', style: TextStyle(fontSize: 23)),
|
||||
const SizedBox(width: 8),
|
||||
const Text('医生审核意见', style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xFF2E7D32))),
|
||||
const Text('医生审核意见', style: TextStyle(fontSize: 19, fontWeight: FontWeight.w600, 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, 19)}', style: const TextStyle(fontSize: 12, color: Color(0xFF81C784))),
|
||||
Text('审核时间:${report.reviewedAt!.toLocal().toString().substring(0, 19)}', style: const TextStyle(fontSize: 15, color: Color(0xFF81C784))),
|
||||
],
|
||||
if (report.severity != null) ...[
|
||||
const SizedBox(height: 6),
|
||||
@@ -516,7 +518,7 @@ class _ReportDetailPageState extends ConsumerState<ReportDetailPage> {
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Text('💬 ${report.doctorComment!}', style: const TextStyle(fontSize: 15, color: Color(0xFF1A1A1A), height: 1.5)),
|
||||
child: Text('💬 ${report.doctorComment!}', style: const TextStyle(fontSize: 18, color: Color(0xFF1A1A1A), height: 1.5)),
|
||||
),
|
||||
],
|
||||
if (report.doctorRecommendation != null && report.doctorRecommendation!.isNotEmpty) ...[
|
||||
@@ -528,7 +530,7 @@ class _ReportDetailPageState extends ConsumerState<ReportDetailPage> {
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Text('📝 ${report.doctorRecommendation!}', style: const TextStyle(fontSize: 14, color: Color(0xFF333333), height: 1.5)),
|
||||
child: Text('📝 ${report.doctorRecommendation!}', style: const TextStyle(fontSize: 17, color: Color(0xFF333333), height: 1.5)),
|
||||
),
|
||||
],
|
||||
]),
|
||||
@@ -546,7 +548,7 @@ class _ReportDetailPageState extends ConsumerState<ReportDetailPage> {
|
||||
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)),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -559,12 +561,12 @@ class _ReportDetailPageState extends ConsumerState<ReportDetailPage> {
|
||||
),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
Row(children: [
|
||||
const Text('📋', style: TextStyle(fontSize: 24)),
|
||||
const Text('📋', style: TextStyle(fontSize: 28)),
|
||||
const SizedBox(width: 12),
|
||||
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
Text(analysis.reportType, style: const TextStyle(fontSize: 18, fontWeight: FontWeight.w600)),
|
||||
Text(analysis.reportType, style: const TextStyle(fontSize: 21, fontWeight: FontWeight.w600)),
|
||||
const SizedBox(height: 4),
|
||||
const Text('AI 预解读结果', style: TextStyle(fontSize: 14, color: Color(0xFF666666))),
|
||||
const Text('AI 预解读结果', style: TextStyle(fontSize: 17, color: Color(0xFF666666))),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
@@ -582,9 +584,9 @@ class _ReportDetailPageState extends ConsumerState<ReportDetailPage> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(children: [
|
||||
const Text('🧪', style: TextStyle(fontSize: 20)),
|
||||
const Text('🧪', style: TextStyle(fontSize: 23)),
|
||||
const SizedBox(width: 8),
|
||||
const Text('指标分析', style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600)),
|
||||
const Text('指标分析', style: TextStyle(fontSize: 19, fontWeight: FontWeight.w600)),
|
||||
]),
|
||||
),
|
||||
Container(
|
||||
@@ -598,11 +600,11 @@ class _ReportDetailPageState extends ConsumerState<ReportDetailPage> {
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.info_outline, size: 16, color: Color(0xFFE65100)),
|
||||
const Icon(Icons.info_outline, size: 19, color: Color(0xFFE65100)),
|
||||
const SizedBox(width: 6),
|
||||
const Text(
|
||||
'AI 预解读 · 待医生确认',
|
||||
style: TextStyle(fontSize: 13, color: Color(0xFFE65100), fontWeight: FontWeight.w500),
|
||||
style: TextStyle(fontSize: 16, color: Color(0xFFE65100), fontWeight: FontWeight.w500),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -637,15 +639,15 @@ class _ReportDetailPageState extends ConsumerState<ReportDetailPage> {
|
||||
child: Row(children: [
|
||||
Expanded(
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
Text(ind.name, style: const TextStyle(fontSize: 14)),
|
||||
Text(ind.name, style: const TextStyle(fontSize: 17)),
|
||||
if (ind.referenceRange != null)
|
||||
Text('参考值: ${ind.referenceRange}', style: TextStyle(fontSize: 12, color: Colors.grey[400])),
|
||||
Text('参考值: ${ind.referenceRange}', style: TextStyle(fontSize: 15, color: Colors.grey[400])),
|
||||
]),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Column(children: [
|
||||
Text('${ind.value} ${ind.unit}', style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: statusColor)),
|
||||
Icon(statusIcon, size: 16, color: statusColor),
|
||||
Text('${ind.value} ${ind.unit}', style: TextStyle(fontSize: 19, fontWeight: FontWeight.w600, color: statusColor)),
|
||||
Icon(statusIcon, size: 19, color: statusColor),
|
||||
]),
|
||||
]),
|
||||
);
|
||||
@@ -660,12 +662,12 @@ class _ReportDetailPageState extends ConsumerState<ReportDetailPage> {
|
||||
),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
Row(children: [
|
||||
const Text('💡', style: TextStyle(fontSize: 20)),
|
||||
const Text('💡', style: TextStyle(fontSize: 23)),
|
||||
const SizedBox(width: 8),
|
||||
const Text('综合解读', style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xFFD97706))),
|
||||
const Text('综合解读', style: TextStyle(fontSize: 19, fontWeight: FontWeight.w600, color: Color(0xFFD97706))),
|
||||
]),
|
||||
const SizedBox(height: 12),
|
||||
Text(analysis.summary, style: const TextStyle(fontSize: 14, color: Color(0xFF92400E), height: 1.6)),
|
||||
Text(analysis.summary, style: const TextStyle(fontSize: 17, color: Color(0xFF92400E), height: 1.6)),
|
||||
const SizedBox(height: 12),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
@@ -673,7 +675,7 @@ class _ReportDetailPageState extends ConsumerState<ReportDetailPage> {
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: const Text('⚠️ AI 解读仅供参考,请以医生诊断为准', style: TextStyle(fontSize: 13, color: Color(0xFFD97706))),
|
||||
child: const Text('⚠️ AI 解读仅供参考,请以医生诊断为准', style: TextStyle(fontSize: 16, color: Color(0xFFD97706))),
|
||||
),
|
||||
]),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user