Yansen 2 years ago
parent
commit
eda1805f44
1 changed files with 22 additions and 1 deletions
  1. 22
    1
      lib/pages/login/login.dart

+ 22
- 1
lib/pages/login/login.dart View File

13
 import '../../widgets/Cell.dart';
13
 import '../../widgets/Cell.dart';
14
 
14
 
15
 class MyRouteLogin extends StatefulWidget {
15
 class MyRouteLogin extends StatefulWidget {
16
+
17
+  // 从其他页面跳转过来的
18
+  bool isBack = false;
19
+
20
+  @protected
21
+  @mustCallSuper
22
+  void beforeShow() {
23
+    assert(() {
24
+      print("===========beforeShow===========");
25
+      return true;
26
+    }());
27
+
28
+    if (Get.arguments != null) {
29
+      isBack = Get.arguments['isBack'];
30
+    }
31
+  }
32
+
16
   @override
33
   @override
17
   State<MyRouteLogin> createState() => _RouteLogin();
34
   State<MyRouteLogin> createState() => _RouteLogin();
18
 }
35
 }
101
         userLogin(handlePhones, handleCodes).then((value) {
118
         userLogin(handlePhones, handleCodes).then((value) {
102
           userInfo(Person.fromJson(value['person']));
119
           userInfo(Person.fromJson(value['person']));
103
 
120
 
104
-          Get.off(Home());
121
+          if (widget.isBack) {
122
+            Get.back();
123
+          } else {
124
+            Get.off(Home());
125
+          }
105
         });
126
         });
106
       } else {
127
       } else {
107
         Fluttertoast.showToast(msg: '请阅读并同意相关隐私政策!');
128
         Fluttertoast.showToast(msg: '请阅读并同意相关隐私政策!');