ソースを参照

1、优化健康指导页面

guanxinyi 1 年間 前
コミット
66d1ced234
1 ファイル変更61 行追加72 行削除
  1. 61 72
      lib/pages/check/prescription/examination_prescription.dart

+ 61 - 72
lib/pages/check/prescription/examination_prescription.dart

@@ -83,85 +83,74 @@ class _ExaminationPrescriptionState extends State<ExaminationPrescription> {
     return VAlertDialog(
       // title: "新增处方",
       width: width * 0.8 / scale,
-      content: Stack(
+      content: Column(
+        mainAxisAlignment: MainAxisAlignment.center,
         children: [
-          Row(
-            children: [
-              if (widget.prescriptionTitle.isEmpty)
-                Container(
-                  width: 220,
-                  decoration: BoxDecoration(
-                    border: Border(
-                      right: BorderSide(
-                        width: 0.5,
-                        color: Colors.black26,
-                      ),
-                    ),
-                  ),
-                  child: Column(children: [
-                    Expanded(
-                      child: ListView(
-                        shrinkWrap: true,
-                        children: PrescriptionFormKeys.AllFormKeys.entries.map(
-                          (e) {
-                            return Container(
-                              margin: EdgeInsets.symmetric(
-                                vertical: 6,
-                                horizontal: 10,
-                              ),
-                              decoration: BoxDecoration(
-                                border: Border.all(
-                                  color: widget.prescription == e.key
-                                      ? Colors.blue
-                                      : Colors.black26,
-                                ),
-                                borderRadius: const BorderRadius.all(
-                                  Radius.circular(50),
-                                ),
-                                color: widget.prescription == e.key
-                                    ? Colors.blue
-                                    : Colors.transparent,
-                              ),
-                              child: InkWell(
-                                onTap: () => selectRaidoChange(e),
-                                borderRadius: BorderRadius.circular(50),
-                                child: FittedBox(
-                                  child: Container(
-                                    padding: const EdgeInsets.all(12),
-                                    alignment: Alignment.center,
-                                    child: Text(
-                                      e.value,
-                                      style: TextStyle(
-                                        fontSize: 20,
-                                        color: widget.prescription == e.key
-                                            ? Colors.white
-                                            : Colors.black54,
-                                      ),
-                                    ),
+          if (widget.prescriptionTitle.isEmpty)
+            Container(
+              height: Get.height,
+              child: ListView(
+                shrinkWrap: true,
+                children: [
+                  Wrap(
+                    children: PrescriptionFormKeys.AllFormKeys.entries.map(
+                      (e) {
+                        return Container(
+                          margin: EdgeInsets.symmetric(
+                            vertical: 6,
+                            horizontal: 10,
+                          ),
+                          decoration: BoxDecoration(
+                            border: Border.all(
+                              color: widget.prescription == e.key
+                                  ? Colors.blue
+                                  : Colors.black26,
+                            ),
+                            borderRadius: const BorderRadius.all(
+                              Radius.circular(50),
+                            ),
+                            color: widget.prescription == e.key
+                                ? Colors.blue
+                                : Colors.transparent,
+                          ),
+                          child: InkWell(
+                            onTap: () => selectRaidoChange(e),
+                            borderRadius: BorderRadius.circular(50),
+                            child: FittedBox(
+                              child: Container(
+                                padding: const EdgeInsets.all(12),
+                                alignment: Alignment.center,
+                                child: Text(
+                                  e.value,
+                                  style: TextStyle(
+                                    fontSize: 20,
+                                    color: widget.prescription == e.key
+                                        ? Colors.white
+                                        : Colors.black54,
                                   ),
                                 ),
                               ),
-                            );
-                          },
-                        ).toList(),
-                      ),
-                    )
-                  ]),
-                ),
-
-              // 构建处方信息
-              Expanded(
-                key: UniqueKey(),
-                child: Container(
-                  color: Colors.white,
-                  child: _buildPrescription(
-                    widget.prescription,
-                    widget.prescriptionTitle,
+                            ),
+                          ),
+                        );
+                      },
+                    ).toList(),
                   ),
+                ],
+              ),
+            ),
+          if (widget.prescriptionTitle.isNotEmpty)
+            // 构建处方信息
+            Expanded(
+              key: UniqueKey(),
+              child: Container(
+                color: Colors.white,
+                child: _buildPrescription(
+                  widget.prescription,
+                  widget.prescriptionTitle,
                 ),
               ),
-            ],
-          ),
+            ),
         ],
       ),
       onCanceled: () {