feat: 三端抽屉重构 + 配色系统更新 + 后台管理页精调 + 键盘抬起组件

## 抽屉重构
- admin_drawer / doctor_drawer / health_drawer 三端抽屉全部重做
- drawer_shell 增强

## 配色系统
- app_colors / app_module_visuals / app_theme 更新
- app.dart 启动流程调整

## 后台管理页
- admin_doctors_page 大幅重构(+251)
- admin_home / doctor_dashboard / doctor_reports / doctor_home / doctor_followups / doctor_settings 精调

## 患者端
- home_page / chat_messages_view / medication_list / notification_center / remaining_pages / exercise_plan / device / diet / consultation 微调

## 新增
- keyboard_lift.dart: 键盘抬起处理组件
- AGENTS.md: agent 指引文档

## 其他
- api_client IP 适配
- app_future_view 增强
- data_providers 调整
- secondary_page_visuals_test 更新
This commit is contained in:
MingNian
2026-07-19 19:11:30 +08:00
parent ae94ced2d5
commit 0d4fd88ce7
35 changed files with 1022 additions and 644 deletions

View File

@@ -12,99 +12,138 @@ class AdminDrawer extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final currentPage = ref.watch(adminPageProvider);
final pages = ref.read(adminPageProvider.notifier);
final routes = ref.read(routeStackProvider.notifier);
final authNotifier = ref.read(authProvider.notifier);
return DrawerShell(
child: SafeArea(
child: Column(
children: [
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: Row(
child: CustomScrollView(
slivers: [
SliverFillRemaining(
hasScrollBody: false,
child: Column(
children: [
Container(
width: 56,
height: 56,
margin: const EdgeInsets.all(14),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
gradient: AppColors.primaryGradient,
borderRadius: BorderRadius.circular(20),
boxShadow: AppColors.buttonShadow,
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: const Icon(
Icons.admin_panel_settings,
size: 28,
color: Colors.white,
),
),
const SizedBox(width: 12),
const Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
child: Row(
children: [
Text(
'系统管理员',
style: TextStyle(
fontSize: 17,
fontWeight: FontWeight.w600,
color: AppColors.textPrimary,
Container(
width: 56,
height: 56,
decoration: BoxDecoration(
gradient: AppColors.primaryGradient,
borderRadius: BorderRadius.circular(20),
boxShadow: AppColors.buttonShadow,
),
child: const Icon(
Icons.admin_panel_settings,
size: 28,
color: Colors.white,
),
),
SizedBox(height: 3),
Text(
'医生与患者管理',
style: TextStyle(
fontSize: 12,
color: AppColors.textSecondary,
const SizedBox(width: 12),
const Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'系统管理员',
style: TextStyle(
fontSize: 17,
fontWeight: FontWeight.w600,
color: AppColors.textPrimary,
),
),
SizedBox(height: 3),
Text(
'医生与患者管理',
style: TextStyle(
fontSize: 12,
color: AppColors.textSecondary,
),
),
],
),
),
],
),
),
const SizedBox(height: 8),
_MenuItem(
icon: Icons.local_hospital,
label: '医生管理',
selected: currentPage == 'doctors',
onTap: () => runAfterDrawerClose(
context,
() => pages.set('doctors'),
),
),
_MenuItem(
icon: Icons.people_outline,
label: '患者列表',
selected: currentPage == 'patients',
onTap: () => runAfterDrawerClose(
context,
() => pages.set('patients'),
),
),
const Spacer(),
const Divider(height: 1, color: AppColors.divider),
const SizedBox(height: 8),
_MenuItem(
icon: Icons.delete_forever_outlined,
label: '删除账号',
danger: true,
onTap: () async {
final confirmed = await confirmAccountAction(
context,
title: '删除账号',
message: '此操作会永久删除当前管理员账号及相关数据,删除后无法恢复。',
confirmLabel: '确认删除',
);
if (!confirmed || !context.mounted) return;
await runAfterDrawerClose(context, () async {
await ref
.read(apiClientProvider)
.delete('/api/user/account');
await authNotifier.logout();
routes.replace('login');
});
},
),
_MenuItem(
icon: Icons.logout,
label: '退出登录',
danger: true,
onTap: () async {
final confirmed = await confirmAccountAction(
context,
title: '退出登录',
message: '确定退出当前管理员账号吗?',
confirmLabel: '退出登录',
);
if (!confirmed || !context.mounted) return;
await runAfterDrawerClose(context, () async {
await authNotifier.logout();
routes.replace('login');
});
},
),
const SizedBox(height: 16),
],
),
),
const SizedBox(height: 8),
_MenuItem(
icon: Icons.local_hospital,
label: '医生管理',
selected: currentPage == 'doctors',
onTap: () {
Navigator.pop(context);
ref.read(adminPageProvider.notifier).set('doctors');
},
),
_MenuItem(
icon: Icons.people_outline,
label: '患者列表',
selected: currentPage == 'patients',
onTap: () {
Navigator.pop(context);
ref.read(adminPageProvider.notifier).set('patients');
},
),
const Spacer(),
const Divider(height: 1, color: AppColors.divider),
const SizedBox(height: 8),
_MenuItem(
icon: Icons.logout,
label: '退出登录',
danger: true,
onTap: () async {
Navigator.pop(context);
await ref.read(authProvider.notifier).logout();
goRoute(ref, 'login');
},
),
const SizedBox(height: 16),
],
),
),