|
@@ -163,13 +163,10 @@ class _HeartRateState extends State<HeartRate> {
|
|
}
|
|
}
|
|
}),
|
|
}),
|
|
),
|
|
),
|
|
- if (showResetButton)
|
|
+ Container(
|
|
- _buildResetButton()
|
|
+
|
|
- else
|
|
+ child: _buildResetButton(),
|
|
-
|
|
+ ),
|
|
- const SizedBox(
|
|
|
|
- height: 48,
|
|
|
|
- ),
|
|
|
|
],
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
@@ -183,30 +180,36 @@ class _HeartRateState extends State<HeartRate> {
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
- Widget _buildDebugButton() {
|
|
+
|
|
- return Container(
|
|
+
|
|
- child: Row(
|
|
+
|
|
- children: [
|
|
+
|
|
- const Text(
|
|
+
|
|
- '测试============?',
|
|
+
|
|
- style: TextStyle(color: Colors.grey, fontSize: 24),
|
|
+
|
|
- ),
|
|
+
|
|
- TextButton(
|
|
+
|
|
- onPressed: () {
|
|
+
|
|
- debugTest();
|
|
+
|
|
- },
|
|
+
|
|
- child: const Text(
|
|
+
|
|
- '重试',
|
|
+
|
|
- style: TextStyle(color: Colors.blue, fontSize: 24),
|
|
+
|
|
- ),
|
|
+
|
|
- ),
|
|
+
|
|
- ],
|
|
+
|
|
- ),
|
|
+
|
|
- );
|
|
+
|
|
- }
|
|
+
|
|
|
|
|
|
Widget _buildResetButton() {
|
|
Widget _buildResetButton() {
|
|
|
|
+ if (!showResetButton) {
|
|
|
|
+ return const SizedBox(
|
|
|
|
+ height: 48,
|
|
|
|
+ );
|
|
|
|
+ }
|
|
return Container(
|
|
return Container(
|
|
|
|
+ padding: const EdgeInsets.only(left: 30),
|
|
child: Row(
|
|
child: Row(
|
|
children: [
|
|
children: [
|
|
const Text(
|
|
const Text(
|
|
@@ -285,7 +288,7 @@ class _HeartRateState extends State<HeartRate> {
|
|
if (initEcgData != null &&
|
|
if (initEcgData != null &&
|
|
initEcgData!.isNotEmpty &&
|
|
initEcgData!.isNotEmpty &&
|
|
initEcgData!.length < 125 * 30) {
|
|
initEcgData!.length < 125 * 30) {
|
|
- print("数据不完整 ⭐⭐⭐⭐⭐⭐⭐");
|
|
+
|
|
showResetButton = true;
|
|
showResetButton = true;
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -403,6 +406,7 @@ class _HeartRateState extends State<HeartRate> {
|
|
|
|
|
|
void _onHrValueUpdate(_, int e) {
|
|
void _onHrValueUpdate(_, int e) {
|
|
logger.i('心率更新:$e');
|
|
logger.i('心率更新:$e');
|
|
|
|
+
|
|
if (_deviceError.isNotEmpty || _assess.isNotEmpty) {
|
|
if (_deviceError.isNotEmpty || _assess.isNotEmpty) {
|
|
|
|
|
|
_deviceError = '';
|
|
_deviceError = '';
|
|
@@ -411,6 +415,7 @@ class _HeartRateState extends State<HeartRate> {
|
|
}
|
|
}
|
|
setState(() {
|
|
setState(() {
|
|
_heart = e.toString();
|
|
_heart = e.toString();
|
|
|
|
+ showResetButton = false;
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
@@ -437,11 +442,17 @@ class _HeartRateState extends State<HeartRate> {
|
|
|
|
|
|
|
|
|
|
if (ecgPoint.isNotEmpty && ecgPoint.length < 125 * 30) {
|
|
if (ecgPoint.isNotEmpty && ecgPoint.length < 125 * 30) {
|
|
- print("数据不完整 ⭐⭐⭐⭐⭐⭐⭐");
|
|
+
|
|
showResetButton = true;
|
|
showResetButton = true;
|
|
}
|
|
}
|
|
- medicalController.saveCachedRecord();
|
|
+
|
|
- print(medicalController.diagnosisDataValue);
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
setState(() {});
|
|
setState(() {});
|
|
}
|
|
}
|
|
|
|
|