更新睡眠报告
This commit is contained in:
@@ -7,6 +7,7 @@ import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
|
||||
import 'package:vbvs_app/pages/sleep_report/chart/HorizontalBarChart.dart';
|
||||
import 'package:EasyDartModule/EasyDartModule.dart' as es;
|
||||
|
||||
class DiseasePercentsWidget extends StatefulWidget {
|
||||
var sleepReport;
|
||||
@@ -17,51 +18,7 @@ class DiseasePercentsWidget extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _DiseasePercentsWidgetState extends State<DiseasePercentsWidget> {
|
||||
// var showLabel = [
|
||||
// {
|
||||
// "key": 1,
|
||||
// "name": "心脏病",
|
||||
// "color": stringToColor("#00C1AA"),
|
||||
// "percent": 45,
|
||||
// "explain": "心脏病是指心脏的结构或功能异常,可能导致心脏无法有效地泵血。"
|
||||
// },
|
||||
// {
|
||||
// "key": 2,
|
||||
// "name": "高血压",
|
||||
// "color": stringToColor("#00C1AA"),
|
||||
// "percent": 32,
|
||||
// "explain": "高血压是指血液在动脉中流动时对血管壁施加的压力过高。"
|
||||
// },
|
||||
// {
|
||||
// "key": 3,
|
||||
// "name": "糖尿病",
|
||||
// "color": stringToColor("#00C1AA"),
|
||||
// "percent": 50,
|
||||
// "explain": "糖尿病是一种代谢性疾病,导致血糖水平异常升高。"
|
||||
// },
|
||||
// {
|
||||
// "key": 4,
|
||||
// "name": "甲亢",
|
||||
// "color": stringToColor("#FF7159"),
|
||||
// "percent": 80,
|
||||
// "explain": "甲亢是指甲状腺分泌过多的甲状腺激素,导致新陈代谢加速。"
|
||||
// },
|
||||
// {
|
||||
// "key": 5,
|
||||
// "name": "消化系统",
|
||||
// "color": stringToColor("#00C1AA"),
|
||||
// "percent": 12,
|
||||
// "explain": "消化系统是身体中处理食物的机构,是造成疾病和疾病症状的来源。",
|
||||
// },
|
||||
// {
|
||||
// "key": 6,
|
||||
// "name": "呼吸系统",
|
||||
// "color": stringToColor("#00C1AA"),
|
||||
// "percent": 62,
|
||||
// "explain": "呼吸系统是负责气体交换的器官系统,包括鼻、喉、气管和肺等。",
|
||||
// },
|
||||
// ];
|
||||
|
||||
|
||||
@override
|
||||
void setState(VoidCallback callback) {
|
||||
super.setState(callback);
|
||||
@@ -79,7 +36,8 @@ class _DiseasePercentsWidgetState extends State<DiseasePercentsWidget> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (widget.sleepReport == null ||
|
||||
try {
|
||||
if (widget.sleepReport == null ||
|
||||
widget.sleepReport['cdri'] == null ||
|
||||
widget.sleepReport['cdri'].isEmpty) {
|
||||
return Container();
|
||||
@@ -157,6 +115,11 @@ class _DiseasePercentsWidgetState extends State<DiseasePercentsWidget> {
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
} catch (e) {
|
||||
es.EasyDartModule.logger.error("打鼾监测绘制异常${e}");
|
||||
return Container();
|
||||
}
|
||||
}
|
||||
|
||||
List<Map<String, dynamic>> convertDiseaseData(List data) {
|
||||
|
||||
Reference in New Issue
Block a user