Files
AI-Health/health_app/lib/widgets/doctor_drawer.dart
MingNian 6e5d3e64cd feat: 健康仪表盘配色调整 + 登录页品牌升级 + iOS 配置 + 隐私文案修订 + 文档清理
## UI 配色
- 健康仪表盘: 背景从蓝紫粉三色渐变改为 #4FACFE 纯色蓝, 白字清晰不抢眼
- app_colors / app_design_tokens / app_theme: 配色体系微调
- 多个 widget 和页面跟随配色更新(health_drawer/admin_drawer/doctor_drawer/enterprise_widgets 等)

## 登录页品牌升级
- 新增品牌素材: drawer_background_v2 / login_background_v2 / health_login_character_transparent
- login_page 重构, 接入新品牌视觉
- app.dart 启动流程调整

## iOS / Android 配置
- Info.plist: 权限描述调整
- AppIcon / LaunchImage: 资源更新
- AndroidManifest: 权限微调

## 隐私文案修订
- privacy.html: 蓝牙设备描述调整为"标准蓝牙血压服务", 移除未上线设备类型表述
- terms.html: 移除"在线医生咨询"相关条款, 服务范围收窄

## 通知中心
- notification_center_page: 重构通知项布局

## 其他
- 删除已完成的计划/spec 文档(ui-system-first-pass / apple-sign-in / secondary-page-color-refresh / notification-preferences-design / ui-design-system)
- 新增 native_navigation_test
- 新增 HANDOFF 交接文档
- home_message_order_test 更新
- .gitignore 调整
2026-07-16 22:30:23 +08:00

250 lines
7.6 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../core/app_colors.dart';
import '../core/navigation_provider.dart';
import '../providers/auth_provider.dart';
import '../pages/doctor/doctor_home_page.dart' show doctorPageProvider;
import 'drawer_shell.dart';
class DoctorDrawer extends ConsumerWidget {
const DoctorDrawer({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
final auth = ref.watch(authProvider);
final currentPage = ref.watch(doctorPageProvider);
final name = auth.user?.name ?? '医生';
return DrawerShell(
child: SafeArea(
child: Column(
children: [
_DrawerHeader(
name: name,
subtitle: '点击完善医生信息',
icon: Icons.medical_services_outlined,
onTap: () {
Navigator.pop(context);
pushRoute(ref, 'doctorProfile');
},
),
const SizedBox(height: 8),
_DrawerItem(
icon: Icons.dashboard_outlined,
label: '工作台',
selected: currentPage == 'dashboard',
onTap: () {
Navigator.pop(context);
ref.read(doctorPageProvider.notifier).set('dashboard');
},
),
_DrawerItem(
icon: Icons.people_outline,
label: '患者管理',
selected: currentPage == 'patients',
onTap: () {
Navigator.pop(context);
ref.read(doctorPageProvider.notifier).set('patients');
},
),
_DrawerItem(
icon: Icons.chat_outlined,
label: '问诊列表',
selected: currentPage == 'consultations',
onTap: () {
Navigator.pop(context);
ref.read(doctorPageProvider.notifier).set('consultations');
},
),
_DrawerItem(
icon: Icons.description_outlined,
label: '报告审核',
selected: currentPage == 'reports',
onTap: () {
Navigator.pop(context);
ref.read(doctorPageProvider.notifier).set('reports');
},
),
_DrawerItem(
icon: Icons.event_note_outlined,
label: '复查随访',
selected: currentPage == 'followups',
onTap: () {
Navigator.pop(context);
ref.read(doctorPageProvider.notifier).set('followups');
},
),
const Spacer(),
const Divider(height: 1, color: AppColors.divider),
const SizedBox(height: 8),
_DrawerItem(
icon: Icons.settings_outlined,
label: '设置',
selected: false,
onTap: () {
Navigator.pop(context);
pushRoute(ref, 'doctorSettings');
},
),
_DrawerItem(
icon: Icons.logout,
label: '退出登录',
selected: false,
danger: true,
onTap: () async {
Navigator.pop(context);
await ref.read(authProvider.notifier).logout();
goRoute(ref, 'login');
},
),
const SizedBox(height: 16),
],
),
),
);
}
}
class _DrawerHeader extends StatelessWidget {
final String name;
final String subtitle;
final IconData icon;
final VoidCallback onTap;
const _DrawerHeader({
required this.name,
required this.subtitle,
required this.icon,
required this.onTap,
});
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.all(14),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.white.withValues(alpha: 0.88),
borderRadius: BorderRadius.circular(22),
border: Border.all(
color: Colors.white.withValues(alpha: 0.86),
width: 1.2,
),
boxShadow: AppColors.cardShadowLight,
),
child: InkWell(
onTap: onTap,
borderRadius: BorderRadius.circular(16),
child: Row(
children: [
Container(
width: 56,
height: 56,
decoration: BoxDecoration(
gradient: AppColors.doctorGradient,
borderRadius: BorderRadius.circular(20),
boxShadow: AppColors.buttonShadow,
),
child: Icon(icon, color: Colors.white, size: 26),
),
const SizedBox(width: 12),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
name,
style: const TextStyle(
fontSize: 17,
fontWeight: FontWeight.w600,
color: AppColors.textPrimary,
),
overflow: TextOverflow.ellipsis,
),
const SizedBox(height: 3),
Text(
subtitle,
style: const TextStyle(
fontSize: 12,
color: AppColors.textSecondary,
),
),
],
),
),
],
),
),
);
}
}
class _DrawerItem extends StatelessWidget {
final IconData icon;
final String label;
final bool selected;
final bool danger;
final VoidCallback onTap;
const _DrawerItem({
required this.icon,
required this.label,
required this.selected,
required this.onTap,
this.danger = false,
});
@override
Widget build(BuildContext context) {
final color = danger
? AppColors.error
: selected
? const Color(0xFF7C5CFF)
: AppColors.textPrimary;
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 4),
child: Material(
color: Colors.transparent,
borderRadius: BorderRadius.circular(14),
child: InkWell(
borderRadius: BorderRadius.circular(14),
onTap: onTap,
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 12),
decoration: BoxDecoration(
gradient: selected
? AppColors.doctorGradient
: AppColors.surfaceGradient,
borderRadius: BorderRadius.circular(14),
border: Border.all(
color: selected
? Colors.white.withValues(alpha: 0.80)
: AppColors.borderLight,
width: 1.1,
),
boxShadow: selected
? AppColors.buttonShadow
: AppColors.cardShadowLight,
),
child: Row(
children: [
Icon(icon, size: 20, color: selected ? Colors.white : color),
const SizedBox(width: 12),
Expanded(
child: Text(
label,
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w700,
color: selected ? Colors.white : color,
),
),
),
],
),
),
),
),
);
}
}