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:
@@ -521,10 +521,19 @@ class _NotificationRow extends StatelessWidget {
|
||||
width: 40,
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: visual.lightColor,
|
||||
color: visual.lightIconSurface
|
||||
? AppColors.device
|
||||
: null,
|
||||
gradient: visual.lightIconSurface
|
||||
? null
|
||||
: visual.gradient,
|
||||
borderRadius: AppRadius.smBorder,
|
||||
),
|
||||
child: Icon(visual.icon, size: 21, color: visual.color),
|
||||
child: Icon(
|
||||
visual.icon,
|
||||
size: 21,
|
||||
color: visual.iconColor,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 11),
|
||||
Expanded(
|
||||
@@ -657,46 +666,66 @@ class _NotificationVisual {
|
||||
final IconData icon;
|
||||
final Color color;
|
||||
final Color lightColor;
|
||||
final Gradient gradient;
|
||||
final Color iconColor;
|
||||
final bool lightIconSurface;
|
||||
final String label;
|
||||
|
||||
const _NotificationVisual(this.icon, this.color, this.lightColor, this.label);
|
||||
const _NotificationVisual(
|
||||
this.icon,
|
||||
this.color,
|
||||
this.lightColor,
|
||||
this.gradient,
|
||||
this.iconColor,
|
||||
this.lightIconSurface,
|
||||
this.label,
|
||||
);
|
||||
|
||||
factory _NotificationVisual.fromModule(AppModuleVisual visual) {
|
||||
factory _NotificationVisual.fromModule(
|
||||
AppModuleVisual visual, {
|
||||
Color iconColor = Colors.white,
|
||||
bool lightIconSurface = false,
|
||||
}) {
|
||||
return _NotificationVisual(
|
||||
visual.icon,
|
||||
visual.color,
|
||||
visual.lightColor,
|
||||
visual.gradient,
|
||||
iconColor,
|
||||
lightIconSurface,
|
||||
visual.label,
|
||||
);
|
||||
}
|
||||
|
||||
factory _NotificationVisual.of(InAppNotification item) {
|
||||
final kind = item.actionType ?? item.type;
|
||||
final kind = (item.actionType ?? item.type).toLowerCase();
|
||||
switch (kind) {
|
||||
case 'exercise':
|
||||
case 'exercisereminder':
|
||||
return _NotificationVisual.fromModule(AppModuleVisuals.exercise);
|
||||
case 'health':
|
||||
return item.severity == 'critical'
|
||||
? const _NotificationVisual(
|
||||
LucideIcons.triangleAlert,
|
||||
AppColors.errorText,
|
||||
AppColors.errorLight,
|
||||
'紧急',
|
||||
)
|
||||
: _NotificationVisual.fromModule(AppModuleVisuals.health);
|
||||
case 'health_record_reminder':
|
||||
return _NotificationVisual.fromModule(AppModuleVisuals.health);
|
||||
case 'report':
|
||||
return item.severity == 'error'
|
||||
? const _NotificationVisual(
|
||||
LucideIcons.fileWarning,
|
||||
AppColors.errorText,
|
||||
AppColors.errorLight,
|
||||
'报告',
|
||||
)
|
||||
: _NotificationVisual.fromModule(AppModuleVisuals.report);
|
||||
return _NotificationVisual.fromModule(AppModuleVisuals.report);
|
||||
case 'medication':
|
||||
case 'medicationreminder':
|
||||
return _NotificationVisual.fromModule(AppModuleVisuals.medication);
|
||||
case 'diet':
|
||||
return _NotificationVisual.fromModule(AppModuleVisuals.diet);
|
||||
case 'followup':
|
||||
case 'follow_up_reminder':
|
||||
return _NotificationVisual.fromModule(AppModuleVisuals.followup);
|
||||
case 'doctor':
|
||||
case 'consultation':
|
||||
return _NotificationVisual.fromModule(AppModuleVisuals.doctor);
|
||||
case 'device':
|
||||
case 'bluetooth':
|
||||
return _NotificationVisual.fromModule(
|
||||
AppModuleVisuals.device,
|
||||
iconColor: Colors.white,
|
||||
lightIconSurface: true,
|
||||
);
|
||||
default:
|
||||
return _NotificationVisual.fromModule(AppModuleVisuals.notification);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user