|
...
|
...
|
@@ -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();
|
|
|
|
}
|
...
|
...
|
|