Browse Source

fixed: 0018670: 【高血压/2型糖尿病】血压一项后面不显示单位

loki.wu 10 months ago
parent
commit
cc618865b6
1 changed files with 26 additions and 8 deletions
  1. 26 8
      lib/pages/check/widgets/exam_configurable/follow_blood_pressure.dart

+ 26 - 8
lib/pages/check/widgets/exam_configurable/follow_blood_pressure.dart

@@ -227,7 +227,10 @@ class _FollowBloodPressureState extends State<FollowBloodPressure> {
               InkWell(
                 child: SideBar(
                   title: '血压',
-                  value: _buildResult(_nibpExamValue),
+                  value: _buildResult(
+                    _nibpExamValue,
+                    ' mmHg',
+                  ),
                   unit: 'mmHg',
                   required: widget.currentFormObject.required,
                 ),
@@ -259,7 +262,7 @@ class _FollowBloodPressureState extends State<FollowBloodPressure> {
     );
   }
 
-  Widget _buildResult(NibpExamValue? nibpExamValue) {
+  Widget _buildResult(NibpExamValue? nibpExamValue, String? unit) {
     const textStyle = TextStyle(fontSize: 26, color: Colors.black);
 
     return Row(
@@ -271,16 +274,31 @@ class _FollowBloodPressureState extends State<FollowBloodPressure> {
           children: [
             Align(
               alignment: Alignment.centerLeft,
-              child: Text(
-                nibpExamValue?.systolicPressure.toString() ?? '',
-                style: textStyle,
+              child: RichText(
+                text: TextSpan(
+                    text: nibpExamValue?.systolicPressure.toString() ?? '',
+                    style: textStyle,
+                    children: [
+                      TextSpan(
+                        text: unit ?? '',
+                        style: textStyle.copyWith(fontSize: 20),
+                      ),
+                    ]),
               ),
             ),
             Align(
               alignment: Alignment.centerRight,
-              child: Text(
-                nibpExamValue?.diastolicPressure.toString() ?? '',
-                style: textStyle,
+              child: RichText(
+                text: TextSpan(
+                  text: nibpExamValue?.diastolicPressure.toString() ?? '',
+                  style: textStyle,
+                  children: [
+                    TextSpan(
+                      text: unit ?? '',
+                      style: textStyle.copyWith(fontSize: 20),
+                    ),
+                  ],
+                ),
               ),
             ),
           ],