瀏覽代碼

指定字体

loki.wu 10 月之前
父節點
當前提交
6e9d7aee54
共有 1 個文件被更改,包括 58 次插入9 次删除
  1. 58 9
      lib/pages/medical_checkup_station/registration/controller.dart

+ 58 - 9
lib/pages/medical_checkup_station/registration/controller.dart

@@ -74,6 +74,8 @@ class RegistrationController extends GetxController
   }
 
   Future<void> getExamLabelsByExamNoAsync(ResidentModel rowData) async {
+    // await drawBarcode(HealthExamLabelDTO(uniquedCode: "123"), rowData);
+    // Future.delayed(Duration(milliseconds: 2000));
     var labels = await registrationManager.getExamLabelsByExamNoAsync(
         physicalExamNumber: rowData.physicalExamNumber!);
     barCodeList.clear();
@@ -99,6 +101,7 @@ class RegistrationController extends GetxController
       labelDto.uniquedCode!,
       width: 350,
       height: 120,
+      fontFamily: "NotoSansSC",
     );
     final PictureInfo pictureInfo =
         await vg.loadPicture(SvgStringLoader(svg), null);
@@ -117,6 +120,7 @@ class RegistrationController extends GetxController
       labelDto.uniquedCode!,
       width: 190,
       height: 190,
+      fontFamily: "NotoSansSC",
     );
     final PictureInfo pictureInfo =
         await vg.loadPicture(SvgStringLoader(svg), null);
@@ -190,7 +194,12 @@ class InfoPainter extends CustomPainter {
     // Simulate drawing the content
     TextSpan titleSpan = TextSpan(
       text: '${labelDto.title ?? ''}',
-      style: TextStyle(fontSize: 40, height: 1, color: Colors.black),
+      style: TextStyle(
+        fontSize: 40,
+        height: 1,
+        color: Colors.black,
+        fontFamily: "NotoSansSC",
+      ),
     );
     TextPainter titleTp = TextPainter(
       text: titleSpan,
@@ -202,7 +211,12 @@ class InfoPainter extends CustomPainter {
 
     TextSpan subTitleSpanName = TextSpan(
       text: '${resident.name} ',
-      style: TextStyle(fontSize: 26, height: 1, color: Colors.black),
+      style: TextStyle(
+        fontSize: 26,
+        height: 1,
+        color: Colors.black,
+        fontFamily: "NotoSansSC",
+      ),
     );
     TextPainter subTitleTp1 = TextPainter(
       text: subTitleSpanName,
@@ -214,7 +228,12 @@ class InfoPainter extends CustomPainter {
 
     TextSpan subTitleSpanAge = TextSpan(
       text: '${resident.age} 岁',
-      style: TextStyle(fontSize: 26, height: 1, color: Colors.black),
+      style: TextStyle(
+        fontSize: 26,
+        height: 1,
+        color: Colors.black,
+        fontFamily: "NotoSansSC",
+      ),
     );
     TextPainter subTitleTpAge = TextPainter(
       text: subTitleSpanAge,
@@ -226,7 +245,12 @@ class InfoPainter extends CustomPainter {
 
     TextSpan subTitleSpanGender = TextSpan(
       text: '${resident.sex}',
-      style: TextStyle(fontSize: 26, height: 1, color: Colors.black),
+      style: TextStyle(
+        fontSize: 26,
+        height: 1,
+        color: Colors.black,
+        fontFamily: "NotoSansSC",
+      ),
     );
     TextPainter subTitleTpGender = TextPainter(
       text: subTitleSpanGender,
@@ -279,7 +303,12 @@ class QRInfoPainter extends CustomPainter {
     // Simulate drawing the content
     TextSpan titleSpan = TextSpan(
       text: '${labelDto.title ?? ''}',
-      style: TextStyle(fontSize: 40, height: 1, color: Colors.black),
+      style: TextStyle(
+        fontSize: 40,
+        height: 1,
+        color: Colors.black,
+        fontFamily: "NotoSansSC",
+      ),
     );
     TextPainter titleTp = TextPainter(
       text: titleSpan,
@@ -291,7 +320,12 @@ class QRInfoPainter extends CustomPainter {
 
     TextSpan subTitleSpanName = TextSpan(
       text: '${resident.name} ',
-      style: TextStyle(fontSize: 30, height: 1, color: Colors.black),
+      style: TextStyle(
+        fontSize: 30,
+        height: 1,
+        color: Colors.black,
+        fontFamily: "NotoSansSC",
+      ),
     );
     TextPainter subTitleTp1 = TextPainter(
       text: subTitleSpanName,
@@ -303,7 +337,12 @@ class QRInfoPainter extends CustomPainter {
 
     TextSpan subTitleSpanAge = TextSpan(
       text: '${resident.age} 岁',
-      style: TextStyle(fontSize: 30, height: 1, color: Colors.black),
+      style: TextStyle(
+        fontSize: 30,
+        height: 1,
+        color: Colors.black,
+        fontFamily: "NotoSansSC",
+      ),
     );
     TextPainter subTitleTpAge = TextPainter(
       text: subTitleSpanAge,
@@ -315,7 +354,12 @@ class QRInfoPainter extends CustomPainter {
 
     TextSpan subTitleSpanGender = TextSpan(
       text: '${resident.sex}',
-      style: TextStyle(fontSize: 30, height: 1, color: Colors.black),
+      style: TextStyle(
+        fontSize: 30,
+        height: 1,
+        color: Colors.black,
+        fontFamily: "NotoSansSC",
+      ),
     );
     TextPainter subTitleTpGender = TextPainter(
       text: subTitleSpanGender,
@@ -327,7 +371,12 @@ class QRInfoPainter extends CustomPainter {
 
     TextSpan uniqueCode = TextSpan(
       text: '${labelDto.uniquedCode}',
-      style: TextStyle(fontSize: 24, height: 1, color: Colors.black),
+      style: TextStyle(
+        fontSize: 24,
+        height: 1,
+        color: Colors.black,
+        fontFamily: "NotoSansSC",
+      ),
     );
     TextPainter uniqueCodePainter = TextPainter(
       text: uniqueCode,