|
@@ -124,15 +124,8 @@ class _ExamBodyWeightState extends State<BodyWeight> {
|
|
|
setState(() {});
|
|
|
}
|
|
|
|
|
|
- void _onDeviceCloseSuccess(sender, e) {
|
|
|
- if (e) {
|
|
|
- connect();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
void _onConnectFail(sender, e) {
|
|
|
print('连接设备失败');
|
|
|
-
|
|
|
isConnectFail = true;
|
|
|
_connectStatus = WorkerStatus.connectionFailed;
|
|
|
|
|
@@ -141,7 +134,6 @@ class _ExamBodyWeightState extends State<BodyWeight> {
|
|
|
|
|
|
void _onDisconnected(sender, e) {
|
|
|
print('设备连接中断');
|
|
|
-
|
|
|
isConnectFail = true;
|
|
|
_connectStatus = WorkerStatus.disconnected;
|
|
|
setState(() {});
|
|
@@ -227,9 +219,15 @@ class _ExamBodyWeightState extends State<BodyWeight> {
|
|
|
).show();
|
|
|
if (result?.isNotEmpty ?? false) {
|
|
|
_weight = result ?? '';
|
|
|
- getBmi();
|
|
|
- controller.diagnosisDataValue['BMI']?['Weight'] = _weight;
|
|
|
- controller.diagnosisDataValue['BMI']?['Bmi'] = _bmi;
|
|
|
+ if (_height.isNotEmpty) {
|
|
|
+ getBmi();
|
|
|
+ }
|
|
|
+ controller.diagnosisDataValue['BMI'] = {
|
|
|
+ 'Height': _height,
|
|
|
+ 'Bmi': _bmi,
|
|
|
+ 'Weight': _weight,
|
|
|
+ };
|
|
|
+
|
|
|
controller.saveCachedRecord();
|
|
|
}
|
|
|
setState(() {});
|
|
@@ -252,13 +250,14 @@ class _ExamBodyWeightState extends State<BodyWeight> {
|
|
|
if (result?.isNotEmpty ?? false) {
|
|
|
_height = result ?? '';
|
|
|
|
|
|
- // getBmi();
|
|
|
- controller.diagnosisDataValue['BMI']?['Height'] = _height;
|
|
|
if (_weight.isNotEmpty) {
|
|
|
getBmi();
|
|
|
- controller.diagnosisDataValue['BMI']?['Bmi'] = _bmi;
|
|
|
}
|
|
|
- // controller.diagnosisDataValue['BMI']?['Bmi'] = _bmi;
|
|
|
+ controller.diagnosisDataValue['BMI'] = {
|
|
|
+ 'Height': _height,
|
|
|
+ 'Bmi': _bmi,
|
|
|
+ 'Weight': _weight,
|
|
|
+ };
|
|
|
controller.saveCachedRecord();
|
|
|
}
|
|
|
setState(() {});
|