feat: 血压计联动心率记录 + 侧边栏左滑手势
- 血压计测量含脉搏时自动同步为 HeartRate 记录 - 首页 Scaffold 增加左侧滑手势打开侧边栏
This commit is contained in:
@@ -151,9 +151,12 @@ class _DeviceScanPageState extends ConsumerState<DeviceScanPage>
|
|||||||
_pulse = reading.pulse;
|
_pulse = reading.pulse;
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
await ref
|
final api = ref.read(apiClientProvider);
|
||||||
.read(apiClientProvider)
|
await api.post('/api/health-records', data: reading.toHealthRecord());
|
||||||
.post('/api/health-records', data: reading.toHealthRecord());
|
final heartRateRecord = reading.toHeartRateRecord();
|
||||||
|
if (heartRateRecord != null) {
|
||||||
|
await api.post('/api/health-records', data: heartRateRecord);
|
||||||
|
}
|
||||||
await ref.read(omronDeviceProvider.notifier).onReading(reading);
|
await ref.read(omronDeviceProvider.notifier).onReading(reading);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
debugPrint('[PAGE] 上报失败: $e');
|
debugPrint('[PAGE] 上报失败: $e');
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ class _HomePageState extends ConsumerState<HomePage> {
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
drawer: const HealthDrawer(),
|
drawer: const HealthDrawer(),
|
||||||
|
drawerEdgeDragWidth: MediaQuery.of(context).size.width * 0.35,
|
||||||
body: AppBackground(
|
body: AppBackground(
|
||||||
safeArea: true,
|
safeArea: true,
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|||||||
Reference in New Issue
Block a user