- UI 系统: 新增 design_tokens / module_visuals / app_buttons / app_status_badge / app_toast / ai_content 六个共享模块; 28 个页面接入, SnackBar 全部替换为 AppToast - 趋势图: 直线折线 + 渐变填充 + 阴影; 去网格线; X 轴日+月份分隔; Y 轴整数刻度最多 4 个; 点击数据点/录入记录显示上方浮层, 选中点变实心 - 法律文档 H5: 后端 wwwroot 托管隐私政策/服务协议/关于/个人信息收集清单/第三方 SDK 清单 + 索引页; Program.cs 启用 UseDefaultFiles + UseStaticFiles - 其他: auth_provider 登录流程调整; api_client IP 适配; 主页智能体栏间距优化
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(
|
|
gradient: AppModuleVisuals.device.gradient,
|
|
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.w900,
|
|
color: AppColors.textPrimary,
|
|
height: 1,
|
|
),
|
|
),
|
|
const SizedBox(height: 6),
|
|
Text(unit, style: AppTextStyles.tag),
|
|
const SizedBox(height: 4),
|
|
Text(label, style: AppTextStyles.tag),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|