loki.wu 10 сар өмнө
parent
commit
8cb65732cc

+ 2 - 0
lib/architecture/utils/prompt_box.dart

@@ -139,6 +139,7 @@ class PromptBox {
     String message, {
     String? title,
     PromptBoxSnackbarPosition position = PromptBoxSnackbarPosition.Top,
+    Widget? messageText,
   }) {
     final isTop = PromptBoxSnackbarPosition.Top == position;
 
@@ -146,6 +147,7 @@ class PromptBox {
       title ?? "提示",
       message,
       maxWidth: 400,
+      messageText: messageText,
       snackPosition: isTop ? SnackPosition.TOP : SnackPosition.BOTTOM,
       margin: isTop
           ? const EdgeInsets.only(top: 36)

+ 16 - 13
lib/components/cell.dart

@@ -169,24 +169,27 @@ class VListFormCell extends StatelessWidget {
       widget = isRequired
           ? RichText(
               text: TextSpan(
-                  style: TextStyle(
-                    fontFamily: "NotoSansSC",
-                    fontFamilyFallback: const ["NotoSansSC"],
+                text: '',
+                children: [
+                  TextSpan(
+                    text: "* ",
+                    style: const TextStyle(color: Colors.red, fontSize: 28),
                   ),
-                  children: [
-                    TextSpan(
-                      text: "*",
-                      style: const TextStyle(color: Colors.red, fontSize: 20),
+                  TextSpan(
+                    text: label ?? '',
+                    style: TextStyle(
+                      fontSize: 20,
+                      color: Colors.black,
+                      fontFamily: "NotoSansSC",
+                      fontFamilyFallback: const ["NotoSansSC"],
                     ),
-                    TextSpan(
-                      text: label!,
-                      style: const TextStyle(color: Colors.black, fontSize: 20),
-                    ),
-                  ]),
+                  ),
+                ],
+              ),
             )
           : text;
     }
-    return SizedBox(width: labelWidth ?? 280, child: widget);
+    return Container(width: labelWidth ?? 280, child: widget);
   }
 
   Widget? _buildContent() {

+ 30 - 1
lib/pages/check/follow_up/controller.dart

@@ -2,6 +2,7 @@ import 'dart:convert';
 
 import 'package:fis_common/extensions/string.dart';
 import 'package:fis_jsonrpc/rpc.dart';
+import 'package:flutter/material.dart';
 import 'package:get/get.dart';
 import 'package:vitalapp/architecture/utils/datetime.dart';
 import 'package:vitalapp/architecture/utils/prompt_box.dart';
@@ -111,7 +112,35 @@ class FollowUpController extends GetxController {
       if (state.followUpTime == null ||
           state.nextFollowUpTime == null ||
           state.followUpMode == null) {
-        PromptBox.toast("带*为必填项,不能为空");
+        PromptBox.snackbar("带*为必填项,不能为空",
+            messageText: RichText(
+              text: TextSpan(
+                children: [
+                  TextSpan(
+                    text: "带",
+                    style: const TextStyle(
+                      color: Colors.black,
+                      fontSize: 20,
+                      fontFamily: "NotoSansSC",
+                      fontFamilyFallback: const ["NotoSansSC"],
+                    ),
+                  ),
+                  TextSpan(
+                    text: "*",
+                    style: const TextStyle(color: Colors.red, fontSize: 40),
+                  ),
+                  TextSpan(
+                    text: "为必填项,不能为空",
+                    style: const TextStyle(
+                      color: Colors.black,
+                      fontSize: 20,
+                      fontFamily: "NotoSansSC",
+                      fontFamilyFallback: const ["NotoSansSC"],
+                    ),
+                  ),
+                ],
+              ),
+            ));
         return false;
       }
     }

+ 3 - 3
lib/pages/check/follow_up/widgets/follow_up_from.dart

@@ -108,7 +108,7 @@ class FollowUpFrom extends GetView<FollowUpController> {
           VListFormCell(
             isRequired: ["GXY", "TNB"].contains(cardKey) ? true : false,
             label: '本次随访日期',
-            labelWidth: 130,
+            labelWidth: 145,
             endIcon: Icon(
               Icons.keyboard_arrow_right,
               size: 32,
@@ -139,7 +139,7 @@ class FollowUpFrom extends GetView<FollowUpController> {
           VListFormCell(
             isRequired: ["GXY", "TNB"].contains(cardKey) ? true : false,
             label: '下次随访日期',
-            labelWidth: 130,
+            labelWidth: 145,
             endIcon: Icon(
               Icons.keyboard_arrow_right,
               size: 32,
@@ -197,7 +197,7 @@ class FollowUpFrom extends GetView<FollowUpController> {
           VListFormCell(
             isRequired: ["GXY", "TNB"].contains(cardKey) ? true : false,
             label: '随访方式',
-            labelWidth: 130,
+            labelWidth: 145,
             endIcon: Icon(
               Icons.keyboard_arrow_right,
               size: 32,

+ 36 - 1
lib/pages/check/widgets/configurable_card.dart

@@ -403,7 +403,42 @@ class _ConfigurableFormState extends State<ConfigurableCard> {
                           if (child.required ?? false) {
                             var value = formValue[child.key];
                             if (value == null || value.length <= 0) {
-                              PromptBox.toast("带*为必填项,不能为空");
+                              PromptBox.snackbar(
+                                "带*为必填项,不能为空",
+                                messageText: RichText(
+                                  text: TextSpan(
+                                    children: [
+                                      TextSpan(
+                                        text: "带",
+                                        style: const TextStyle(
+                                          color: Colors.black,
+                                          fontSize: 30,
+                                          fontFamily: "NotoSansSC",
+                                          fontFamilyFallback: const [
+                                            "NotoSansSC"
+                                          ],
+                                        ),
+                                      ),
+                                      TextSpan(
+                                        text: " * ",
+                                        style: const TextStyle(
+                                            color: Colors.red, fontSize: 35),
+                                      ),
+                                      TextSpan(
+                                        text: "为必填项,不能为空",
+                                        style: const TextStyle(
+                                          color: Colors.black,
+                                          fontSize: 30,
+                                          fontFamily: "NotoSansSC",
+                                          fontFamilyFallback: const [
+                                            "NotoSansSC"
+                                          ],
+                                        ),
+                                      ),
+                                    ],
+                                  ),
+                                ),
+                              );
                               return;
                             }
                           }

+ 2 - 2
lib/pages/check/widgets/exam_configurable/exam_card.dart

@@ -52,8 +52,8 @@ class ExamCard extends StatelessWidget {
           children: [
             if (required ?? false)
               TextSpan(
-                text: "*",
-                style: const TextStyle(color: Colors.red, fontSize: 22),
+                text: "* ",
+                style: const TextStyle(color: Colors.red, fontSize: 35),
               ),
             TextSpan(
               text: title ?? '',

+ 2 - 2
lib/pages/check/widgets/exam_configurable/exam_radio_and_select.dart

@@ -53,8 +53,8 @@ class ExamCardRadioSelect extends StatelessWidget {
           children: [
             if (required ?? false)
               TextSpan(
-                text: "*",
-                style: const TextStyle(color: Colors.red, fontSize: 22),
+                text: "* ",
+                style: const TextStyle(color: Colors.red, fontSize: 35),
               ),
             TextSpan(
               text: title ?? '',

+ 2 - 2
lib/pages/check/widgets/exam_configurable/follow_blood_pressure.dart

@@ -335,8 +335,8 @@ class SideBar extends StatelessWidget {
               children: [
                 if (required ?? false)
                   TextSpan(
-                    text: "*",
-                    style: const TextStyle(color: Colors.red, fontSize: 22),
+                    text: "* ",
+                    style: const TextStyle(color: Colors.red, fontSize: 35),
                   ),
                 TextSpan(
                   text: title,

+ 2 - 2
lib/pages/check/widgets/exam_title.dart

@@ -26,8 +26,8 @@ class ExamTitle extends StatelessWidget {
           children: [
             if (required ?? false)
               TextSpan(
-                text: "*",
-                style: const TextStyle(color: Colors.red, fontSize: 20),
+                text: "* ",
+                style: const TextStyle(color: Colors.red, fontSize: 35),
               ),
             TextSpan(
               text: label ?? '',