张延森 3 years ago
parent
commit
e4757109c4
2 changed files with 30 additions and 4 deletions
  1. 13
    4
      lib/models/app.dart
  2. 17
    0
      lib/utils/dialog.dart

+ 13
- 4
lib/models/app.dart View File

@@ -30,10 +30,19 @@ class AppController extends GetxController {
30 30
       });
31 31
     }).catchError((e) {
32 32
       print(e);
33
-      Get.defaultDialog(
34
-        title: e.message,
35
-        onConfirm: () => exit(1),
36
-      );
33
+
34
+      var message = e.message.toString().contains('CANCELED')
35
+          ? '您取消了, 确定后将退出程序'
36
+          : e.message;
37
+
38
+      // Get.dialog();
39
+      // Get.defaultDialog(
40
+      //   title: '提示',
41
+      //   middleText: message,
42
+      //   radius: 8,
43
+      //   textConfirm: '确定',
44
+      //   onConfirm: () => exit(1),
45
+      // );
37 46
     });
38 47
 
39 48
     // 尝试获取一次人员信息

+ 17
- 0
lib/utils/dialog.dart View File

@@ -0,0 +1,17 @@
1
+
2
+
3
+import 'package:flutter/widgets.dart';
4
+
5
+class CommonPopup extends StatelessWidget {
6
+  num? radius;
7
+
8
+  CommonPopup({Key? key, this.radius}) : super(key: key);
9
+
10
+  @override
11
+  Widget build(BuildContext context) {
12
+    // TODO: implement build
13
+    throw UnimplementedError();
14
+  }
15
+
16
+}
17
+