feat: 蓝牙血压计基础架构 + UI配色体系升级
- 新增 AppColors 配色体系(紫蓝渐变 + 超大圆角 + 漂浮卡片) - 新增 OmronBleService(BLE 扫描/连接/SFLOAT 协议解析) - 新增 BpReading 数据模型 + 血压数据自动同步后端 - 新增 DeviceScanPage(血压计扫描绑定页)+ DeviceBindPage(已绑定管理页) - 侧边栏新增"蓝牙设备"入口,ProfilePage 移除设备管理 - Android/iOS BLE 权限配置(BLUETOOTH_SCAN/CONNECT) - AppTheme 升级:新阴影系统、新语义色、圆角放大
This commit is contained in:
33
health_app/lib/models/bp_reading.dart
Normal file
33
health_app/lib/models/bp_reading.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
/// 血压测量数据模型
|
||||
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(),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user