Browse Source

update(usb): 添加对 USB 设备的插拔事件处理

gavin.chen 1 year ago
parent
commit
f3701d60da
1 changed files with 24 additions and 18 deletions
  1. 24 18
      lib/pages/admin/usb_state.dart

+ 24 - 18
lib/pages/admin/usb_state.dart

@@ -1,6 +1,7 @@
 import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
 import 'package:get/get.dart';
+import 'package:vitalapp/architecture/utils/confirm_box.dart';
 import 'package:vitalapp/components/alert_dialog.dart';
 
 class UsbState {
@@ -35,24 +36,29 @@ class UsbState {
   }
 
   void alertReboot() {
-    Get.dialog(
-      VAlertDialog(
-        title: "提示",
-        width: 420,
-        content: Container(
-          height: 32,
-          padding: const EdgeInsets.symmetric(horizontal: 24),
-          alignment: Alignment.center,
-          child: const Text(
-            "检测到 USB 硬件发生变化,为保证程序正常运行,建议重启设备",
-            style: TextStyle(fontSize: 20),
-          ),
-        ),
-        showCancel: false,
-        onConfirm: () async {
-          Get.back();
-        },
-      ),
+    ConfirmBox.showMultiLines(
+      contents: ["检测到 USB 硬件发生变化", "(为保证程序正常运行,建议重启设备)"],
+      width: 500,
+      showCancel: false,
     );
+    // Get.dialog(
+    //   VAlertDialog(
+    //     title: "提示",
+    //     width: 420,
+    //     content: Container(
+    //       height: 32,
+    //       padding: const EdgeInsets.symmetric(horizontal: 24),
+    //       alignment: Alignment.center,
+    //       child: const Text(
+    //         "检测到 USB 硬件发生变化,为保证程序正常运行,建议重启设备",
+    //         style: TextStyle(fontSize: 20),
+    //       ),
+    //     ),
+    //     showCancel: false,
+    //     onConfirm: () async {
+    //       Get.back();
+    //     },
+    //   ),
+    // );
   }
 }