feat: Cupertino滚轮选择器 + 品牌更名 + UI全面优化
- 日期/时间/次数选择器统一改为底部弹出Cupertino滚轮,无单位标签,双横线选区 - App更名为"小脉健康",副标题"血管病患者的AI健康管理助手" - 健康仪表盘及侧边栏移除体重指标,侧边栏背景改为蓝白渐变 - 健康档案按钮移入功能入口网格,与其他入口样式统一 - 记数据智能体配色改为绿色渐变(#A1FFCE→#69DB8F) - 隐私协议/关于页从Text改为MarkdownBody正确渲染 - 运动计划/饮食记录卡片添加边框和阴影 - 服药次数从chip改为滚轮选择器 - 日期显示格式统一为空格分隔(1999 01 01) - 健康档案页背景改为纯白
This commit is contained in:
@@ -20,10 +20,10 @@ class HealthDrawer extends ConsumerWidget {
|
||||
child: DecoratedBox(
|
||||
decoration: const BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [Color(0xFFE0C3FC), Color(0xFFFFFFFF), Color(0xFFDCEEFF)],
|
||||
stops: [0.0, 0.48, 1.0],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [Color(0xFF87CEEB), Color(0xFFFFFFFF)],
|
||||
stops: [0.0, 0.35],
|
||||
),
|
||||
),
|
||||
child: SafeArea(
|
||||
@@ -36,8 +36,6 @@ class HealthDrawer extends ConsumerWidget {
|
||||
children: [
|
||||
_AccountHeader(user: auth.user, ref: ref),
|
||||
const SizedBox(height: 18),
|
||||
_ArchiveAction(ref: ref),
|
||||
const SizedBox(height: 18),
|
||||
_HealthDashboard(latestHealth: latestHealth, ref: ref),
|
||||
const SizedBox(height: 18),
|
||||
_NavigationSection(ref: ref),
|
||||
@@ -141,64 +139,6 @@ class _AccountHeader extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _ArchiveAction extends StatelessWidget {
|
||||
final WidgetRef ref;
|
||||
const _ArchiveAction({required this.ref});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: () => pushRoute(ref, 'healthArchive'),
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.fromLTRB(16, 14, 14, 14),
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
colors: [Color(0xFFE0C3FC), Color(0xFF8EC5FC)],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
border: Border.all(color: Colors.white, width: 1.4),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 44,
|
||||
height: 44,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withValues(alpha: 0.82),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.folder_shared_rounded,
|
||||
color: Color(0xFF14B8A6),
|
||||
size: 23,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
const Expanded(
|
||||
child: Text(
|
||||
'健康档案',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
),
|
||||
),
|
||||
const Icon(
|
||||
Icons.arrow_forward_ios_rounded,
|
||||
size: 16,
|
||||
color: AppColors.textHint,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _HealthDashboard extends StatelessWidget {
|
||||
final AsyncValue<Map<String, dynamic>> latestHealth;
|
||||
final WidgetRef ref;
|
||||
@@ -217,7 +157,7 @@ class _HealthDashboard extends StatelessWidget {
|
||||
backgroundGradient: const LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [Color(0xFF00F2FE), Color(0xFF4FACFE)],
|
||||
colors: [Color(0xFF89F7FE), Color(0xFF66A6FF)],
|
||||
),
|
||||
child: latestHealth.when(
|
||||
data: (data) => _DashboardMetrics(data: data, ref: ref),
|
||||
@@ -243,6 +183,7 @@ class _DashboardMetrics extends StatelessWidget {
|
||||
_MetricInfo(
|
||||
label: '血压',
|
||||
value: _bpText(data['BloodPressure']),
|
||||
unit: 'mmHg',
|
||||
routeType: 'blood_pressure',
|
||||
),
|
||||
_MetricInfo(
|
||||
@@ -263,12 +204,6 @@ class _DashboardMetrics extends StatelessWidget {
|
||||
unit: '%',
|
||||
routeType: 'spo2',
|
||||
),
|
||||
_MetricInfo(
|
||||
label: '体重',
|
||||
value: _metricVal(data['Weight']),
|
||||
unit: 'kg',
|
||||
routeType: 'weight',
|
||||
),
|
||||
];
|
||||
|
||||
return Row(
|
||||
@@ -321,18 +256,18 @@ class _MetricTile extends StatelessWidget {
|
||||
onTap: onTap,
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
child: Container(
|
||||
height: 92,
|
||||
height: 100,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withValues(alpha: 0.30),
|
||||
color: Colors.white.withValues(alpha: 0.22),
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
border: Border.all(color: Colors.white.withValues(alpha: 0.50)),
|
||||
border: Border.all(color: Colors.white.withValues(alpha: 0.40)),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 28,
|
||||
height: 32,
|
||||
child: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: Text(
|
||||
@@ -340,7 +275,7 @@ class _MetricTile extends StatelessWidget {
|
||||
maxLines: 1,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
fontSize: 22,
|
||||
fontSize: 26,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: Colors.white,
|
||||
),
|
||||
@@ -350,13 +285,13 @@ class _MetricTile extends StatelessWidget {
|
||||
if (info.unit != null)
|
||||
Text(
|
||||
info.unit!,
|
||||
style: const TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xE0FFFFFF)),
|
||||
style: const TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xE0FFFFFF)),
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
info.label,
|
||||
style: const TextStyle(
|
||||
fontSize: 12,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w800,
|
||||
color: Colors.white,
|
||||
),
|
||||
@@ -375,6 +310,12 @@ class _NavigationSection extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final items = [
|
||||
_NavItem(
|
||||
icon: Icons.folder_shared_rounded,
|
||||
title: '档案',
|
||||
route: 'healthArchive',
|
||||
colors: const [Color(0xFF6EE7B7), Color(0xFF14B8A6)],
|
||||
),
|
||||
_NavItem(
|
||||
icon: Icons.description_rounded,
|
||||
title: '报告',
|
||||
@@ -445,6 +386,7 @@ class _NavTile extends StatelessWidget {
|
||||
const _NavTile({required this.item, required this.onTap});
|
||||
|
||||
String get _title => switch (item.route) {
|
||||
'healthArchive' => '健康档案',
|
||||
'reports' => '报告管理',
|
||||
'medications' => '用药管理',
|
||||
'dietRecords' => '饮食记录',
|
||||
@@ -455,6 +397,7 @@ class _NavTile extends StatelessWidget {
|
||||
};
|
||||
|
||||
List<Color> get _colors => switch (item.route) {
|
||||
'healthArchive' => const [Color(0xFF34D399), Color(0xFF059669)],
|
||||
'reports' => const [Color(0xFF60A5FA), Color(0xFF2563EB)],
|
||||
'medications' => const [Color(0xFFA78BFA), Color(0xFF7C3AED)],
|
||||
'dietRecords' => const [Color(0xFFF6D365), Color(0xFFF97316)],
|
||||
|
||||
Reference in New Issue
Block a user