Prechádzať zdrojové kódy

我的页面将退出放在右上角

daxu0403 7 rokov pred
rodič
commit
582a32eb67

+ 1 - 30
android/app/src/main/java/com/example/logisticsclient/MainActivity.java

@@ -268,36 +268,7 @@ public class MainActivity extends FlutterActivity {
               eventSink.success(device.getName() + "||" + device.getAddress());
             }
 
-            if ("HM-A320-2920".equals(device.getName())) {
-
-
-              try {
-                //                                int sdk = Build.VERSION.SDK_INT;
-                //                                if (sdk >= 10) {
-                //                                    socket = device.createInsecureRfcommSocketToServiceRecord(SPP_UUID);
-                //                                } else {
-                //                                    socket = device.createRfcommSocketToServiceRecord(SPP_UUID);
-                //                                }
-                //
-                //                                System.out.println("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
-                //                                int i = HPRTPrinterHelper.PortOpen("Bluetooth,"+device.getAddress());
-                //                                System.out.println("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"+i);
-                connnectBT(device.getAddress());
-
-                //                                ZTexpress();
-                Map < String, String > tmap = new HashMap < > ();
-                //                                printOrder(tmap,1);
-
-
-
-
-              } catch (Exception e) {
-                System.out.println("sss" + e.getMessage());
-                e.printStackTrace();
-              }
-
-
-            }
+            
 
             break;
         }

+ 41 - 10
lib/pages/my_page.dart

@@ -40,14 +40,15 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
     "货物外": "6",
     "不打印": "7",
   };
-  static var printTypeMapSecond = {
-    "1":"全部",
-    "2":"配件商",
-    "3":"修理厂",
-    "4":"司机",
-    "5":"货物",
-    "6":"货物外",
-    "7":"不打印",
+  static
+  var printTypeMapSecond = {
+    "1": "全部",
+    "2": "配件商",
+    "3": "修理厂",
+    "4": "司机",
+    "5": "货物",
+    "6": "货物外",
+    "7": "不打印",
   };
   String printType = '全部';
   @override
@@ -73,7 +74,7 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
               name = value;
             });
           });
-          getKey('printType').then((value){
+          getKey('printType').then((value) {
             printType = printTypeMapSecond[value];
           });
         });
@@ -102,6 +103,36 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
             ), ),
           centerTitle: true,
           backgroundColor: Color.fromRGBO(64, 98, 254, 1),
+          actions: < Widget > [
+            InkWell(
+              child: Container(
+                padding: EdgeInsets.only(right: ScreenUtil.getInstance().setWidth(30)),
+                child: Center(
+                  child: Text('退出'),
+                )
+              ),
+              onTap: () {
+                showDialog < Null > (
+                  context: context, //BuildContext对象
+                  barrierDismissible: false,
+                  builder: (BuildContext context) {
+                    return new LoadingDialog( //调用对话框
+                      text: '确认退出?', childCallback: (val) {
+                        if (val) {
+                          clearKey();
+                          Navigator.pushReplacement(context, MaterialPageRoute(builder: (context) {
+                            return LoginPage();
+                          }));
+                        } else {
+                          return;
+                        }
+                      },
+                    );
+                  });
+              },
+            )
+
+          ],
         ),
         body: Container(
           color: Color.fromRGBO(246, 246, 254, 1),
@@ -149,7 +180,7 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
           _passWordWidget(),
           _linkPrint(check),
           _printType(),
-          _quitWidget(context)
+          //_quitWidget(context)
         ],
       ),
     );

+ 1 - 1
lib/pages/order_taking_page.dart

@@ -199,7 +199,7 @@ class _OrderTakingPageState extends State < OrderTakingPage > with AutomaticKeep
       child: Container(
         height: ScreenUtil.getInstance().setHeight(80),
         decoration: BoxDecoration(
-          border: BorderDirectional(bottom: BorderSide(color: Colors.white))
+          border: BorderDirectional(bottom: BorderSide(color: Colors.white,width: 0.5))
         ),
         child: Row(
           children: < Widget > [