Files
AI-Health/health_app/lib/models/bp_reading.dart
MingNian 3964cf2bcb feat: 蓝牙血压计基础架构 + UI配色体系升级
- 新增 AppColors 配色体系(紫蓝渐变 + 超大圆角 + 漂浮卡片)
- 新增 OmronBleService(BLE 扫描/连接/SFLOAT 协议解析)
- 新增 BpReading 数据模型 + 血压数据自动同步后端
- 新增 DeviceScanPage(血压计扫描绑定页)+ DeviceBindPage(已绑定管理页)
- 侧边栏新增"蓝牙设备"入口,ProfilePage 移除设备管理
- Android/iOS BLE 权限配置(BLUETOOTH_SCAN/CONNECT)
- AppTheme 升级:新阴影系统、新语义色、圆角放大
2026-06-09 18:48:58 +08:00

34 lines
770 B
Dart

/// 血压测量数据模型
class BpReading {
final int systolic;
final int diastolic;
final int? pulse;
final DateTime timestamp;
final String? userId;
final bool isKpa;
final bool hasBodyMovement;
final bool hasIrregularPulse;
const BpReading({
required this.systolic,
required this.diastolic,
this.pulse,
required this.timestamp,
this.userId,
this.isKpa = false,
this.hasBodyMovement = false,
this.hasIrregularPulse = false,
});
String get display => '$systolic/$diastolic';
Map<String, dynamic> toHealthRecord() => {
'type': 'BloodPressure',
'systolic': systolic,
'diastolic': diastolic,
'source': 'Device',
'unit': 'mmHg',
'recordedAt': timestamp.toUtc().toIso8601String(),
};
}