Commit 3e1297590550c9ef7fe993bce619e6ac5bc6826c

Authored by 常守达
1 parent 09de606c

fix(today):HRV趋势为空时其他不展示

... ... @@ -485,30 +485,44 @@ class TodayController extends GetMaterialController {
v2HealthData.value = null;
}
switch (await _healthApi.getV2StressScore(friendUserId, intDate)) {
switch (await _healthApi.getV2HrvTrend(friendUserId, intDate)) {
case AppSuccess(:final data):
v2StressScore.value = data;
hrvChartData.assignAll(data.list ?? []);
case AppFailure():
v2StressScore.value = null;
hrvChartData.clear();
}
switch (await _healthApi.getV2LatestHrv(friendUserId, intDate)) {
case AppSuccess(:final data):
v2LatestHrv.value = data;
if (hrvChartData.isNotEmpty) {
v2LatestHrv.value = data;
} else {
v2LatestHrv.value = null;
}
case AppFailure():
v2LatestHrv.value = null;
}
switch (await _healthApi.getV2HrvTrend(friendUserId, intDate)) {
switch (await _healthApi.getV2StressScore(friendUserId, intDate)) {
case AppSuccess(:final data):
hrvChartData.assignAll(data.list ?? []);
{
if (hrvChartData.isNotEmpty) {
v2StressScore.value = data;
} else {
v2StressScore.value = V2StressScore(state: 0);
}
}
case AppFailure():
hrvChartData.clear();
v2StressScore.value = null;
}
switch (await _healthApi.getV2RealtimeStress(friendUserId, intDate)) {
case AppSuccess(:final data):
stressChartData.assignAll(data.list ?? []);
if (hrvChartData.isNotEmpty) {
stressChartData.assignAll(data.list ?? []);
} else {
stressChartData.clear();
}
case AppFailure():
stressChartData.clear();
}
... ...
... ... @@ -105,7 +105,7 @@
"phoneLoginCodeSentSuccess": "Code sent",
"phoneLoginInvalidCode": "Invalid verification code",
"todayHealthDataAuthTitle": "Syncing Health Data",
"todayHealthDataAuthDescription": "DoubleFeel needs access to your Apple Health data to provide stress insights, real-time stress tracking, and health recommendations.\nIf you haven’t granted access, please allow permissions below. If you have already granted access, syncing your health data may take a few minutes. Please try again later.",
"todayHealthDataAuthDescription": "DoubleFeel needs access to your Apple Health data to provide stress analysis, sleep insights, and health reminders. Please complete health data authorization. If already authorized, the first sync may take a few minutes.\nIf your Apple Watch hasn't been worn long enough, there may not be sufficient data yet. Please continue wearing your watch to complete data collection.",
"todayHealthDataAuthAction": "Allow Health Access",
"measureYourHrvNow": "How to take a measurement",
"todayBottomSheetGotIt": "Got it",
... ...
... ... @@ -182,7 +182,7 @@
"@todayHealthDataAuthTitle": {
"description": "今日页健康数据授权卡片标题"
},
"todayHealthDataAuthDescription": "DoubleFeel 需要访问你的 Apple 健康数据,以提供压力提醒、实时压力统计和健康建议。\n如果尚未授权,请点击下方完成授权;如果已经授权,首次同步大量健康数据可能需要等待几分钟,请稍后再试。",
"todayHealthDataAuthDescription": "DoubleFeel需要访问你的Apple健康数据,以提供压力、睡眠分析和健康提醒。请完成健康数据授权。若已授权,首次同步可能需要几分钟。\n如果Apple Watch佩戴时间不足,可能暂无足够数据,请继续佩戴手表以完成数据采集。",
"@todayHealthDataAuthDescription": {
"description": "今日页健康数据授权卡片说明"
},
... ...
... ... @@ -732,7 +732,7 @@ abstract class AppLocalizations {
/// 今日页健康数据授权卡片说明
///
/// In zh, this message translates to:
/// **'DoubleFeel 需要访问你的 Apple 健康数据,以提供压力提醒、实时压力统计和健康建议。\n如果尚未授权,请点击下方完成授权;如果已经授权,首次同步大量健康数据可能需要等待几分钟,请稍后再试。'**
/// **'DoubleFeel需要访问你的Apple健康数据,以提供压力、睡眠分析和健康提醒。请完成健康数据授权。若已授权,首次同步可能需要几分钟。\n如果Apple Watch佩戴时间不足,可能暂无足够数据,请继续佩戴手表以完成数据采集。'**
String get todayHealthDataAuthDescription;
/// 今日页健康数据授权卡片按钮文案
... ...
... ... @@ -343,7 +343,7 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get todayHealthDataAuthDescription =>
'DoubleFeel needs access to your Apple Health data to provide stress insights, real-time stress tracking, and health recommendations.\nIf you haven’t granted access, please allow permissions below. If you have already granted access, syncing your health data may take a few minutes. Please try again later.';
'DoubleFeel needs access to your Apple Health data to provide stress analysis, sleep insights, and health reminders. Please complete health data authorization. If already authorized, the first sync may take a few minutes.\nIf your Apple Watch hasn\'t been worn long enough, there may not be sufficient data yet. Please continue wearing your watch to complete data collection.';
@override
String get todayHealthDataAuthAction => 'Allow Health Access';
... ...
... ... @@ -334,7 +334,7 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get todayHealthDataAuthDescription =>
'DoubleFeel 需要访问你的 Apple 健康数据,以提供压力提醒、实时压力统计和健康建议。\n如果尚未授权,请点击下方完成授权;如果已经授权,首次同步大量健康数据可能需要等待几分钟,请稍后再试。';
'DoubleFeel需要访问你的Apple健康数据,以提供压力、睡眠分析和健康提醒。请完成健康数据授权。若已授权,首次同步可能需要几分钟。\n如果Apple Watch佩戴时间不足,可能暂无足够数据,请继续佩戴手表以完成数据采集。';
@override
String get todayHealthDataAuthAction => '授权访问健康数据';
... ...