## 抽屉重构 - 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 更新
150 lines
4.4 KiB
Dart
150 lines
4.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../core/app_colors.dart';
|
|
import '../core/app_design_tokens.dart';
|
|
import '../core/app_module_visuals.dart';
|
|
import '../models/bp_reading.dart';
|
|
|
|
Future<void> showBleSyncDialog(
|
|
BuildContext context, {
|
|
required BpReading reading,
|
|
}) {
|
|
return showDialog<void>(
|
|
context: context,
|
|
barrierDismissible: false,
|
|
barrierColor: Colors.black.withValues(alpha: 0.54),
|
|
builder: (ctx) => Dialog(
|
|
insetPadding: const EdgeInsets.symmetric(horizontal: 28),
|
|
backgroundColor: Colors.transparent,
|
|
child: Container(
|
|
width: double.infinity,
|
|
constraints: const BoxConstraints(maxWidth: 380),
|
|
padding: const EdgeInsets.fromLTRB(22, 26, 22, 22),
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
borderRadius: AppRadius.xlBorder,
|
|
boxShadow: AppShadows.floating,
|
|
),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Container(
|
|
width: 48,
|
|
height: 48,
|
|
decoration: BoxDecoration(
|
|
color: AppModuleVisuals.device.color,
|
|
borderRadius: AppRadius.mdBorder,
|
|
),
|
|
child: Icon(
|
|
AppModuleVisuals.device.icon,
|
|
color: Colors.white,
|
|
size: 25,
|
|
),
|
|
),
|
|
const SizedBox(height: 14),
|
|
Text(
|
|
'数据已录入',
|
|
textAlign: TextAlign.center,
|
|
style: AppTextStyles.summaryTitle.copyWith(fontSize: 22),
|
|
),
|
|
const SizedBox(height: 22),
|
|
Row(
|
|
children: [
|
|
Expanded(
|
|
child: _MetricCard(
|
|
label: '收缩压',
|
|
value: '${reading.systolic}',
|
|
unit: 'mmHg',
|
|
),
|
|
),
|
|
const SizedBox(width: 14),
|
|
Expanded(
|
|
child: _MetricCard(
|
|
label: '舒张压',
|
|
value: '${reading.diastolic}',
|
|
unit: 'mmHg',
|
|
),
|
|
),
|
|
],
|
|
),
|
|
if (reading.pulse != null) ...[
|
|
const SizedBox(height: 14),
|
|
Row(
|
|
children: [
|
|
Expanded(
|
|
child: _MetricCard(
|
|
label: '脉搏',
|
|
value: '${reading.pulse}',
|
|
unit: 'bpm',
|
|
),
|
|
),
|
|
const Expanded(child: SizedBox.shrink()),
|
|
],
|
|
),
|
|
],
|
|
const SizedBox(height: 26),
|
|
GestureDetector(
|
|
onTap: () => Navigator.pop(ctx),
|
|
child: Container(
|
|
height: 50,
|
|
width: double.infinity,
|
|
alignment: Alignment.center,
|
|
decoration: BoxDecoration(
|
|
gradient: AppModuleVisuals.device.gradient,
|
|
borderRadius: AppRadius.lgBorder,
|
|
boxShadow: AppColors.buttonShadow,
|
|
),
|
|
child: Text(
|
|
'知道了',
|
|
style: AppTextStyles.button.copyWith(color: Colors.white),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
class _MetricCard extends StatelessWidget {
|
|
final String label;
|
|
final String value;
|
|
final String unit;
|
|
|
|
const _MetricCard({
|
|
required this.label,
|
|
required this.value,
|
|
required this.unit,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
|
decoration: BoxDecoration(
|
|
color: AppModuleVisuals.device.lightColor,
|
|
borderRadius: AppRadius.mdBorder,
|
|
border: Border.all(color: AppModuleVisuals.device.borderColor),
|
|
),
|
|
child: Column(
|
|
children: [
|
|
Text(
|
|
value,
|
|
style: const TextStyle(
|
|
fontSize: 36,
|
|
fontWeight: FontWeight.w700,
|
|
color: AppColors.textPrimary,
|
|
height: 1,
|
|
),
|
|
),
|
|
const SizedBox(height: 6),
|
|
Text(unit, style: AppTextStyles.tag),
|
|
const SizedBox(height: 4),
|
|
Text(label, style: AppTextStyles.tag),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|