daxu0403 7 rokov pred
rodič
commit
c62ed9118c
2 zmenil súbory, kde vykonal 130 pridanie a 3 odobranie
  1. 14 3
      lib/pages/send_express_page.dart
  2. 116 0
      lib/send_dialog.dart

+ 14 - 3
lib/pages/send_express_page.dart

@@ -7,7 +7,7 @@ import '../util/util.dart';
 import '../util/api.dart';
 import '../util/models.dart';
 import '../showAlert.dart';
-import '../showDialog.dart';
+import '../send_Dialog.dart';
 
 class SendExpressPage extends StatefulWidget {
   final Widget child;
@@ -667,6 +667,17 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
         ),
       ),
       onTap: () {
+        showDialog < Null > (
+            context: context, //BuildContext对象
+            barrierDismissible: false,
+            builder: (BuildContext context) {
+              return SendDialog( //调用对话框
+                childCallback: (val) {
+
+                },
+              );
+            });
+            return;
         if(!submitStatus){
           return;
         }
@@ -785,8 +796,8 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
             context: context, //BuildContext对象
             barrierDismissible: false,
             builder: (BuildContext context) {
-              return MyAlertDialog( //调用对话框
-                text: '订单提交成功!', childCallback: (val) {
+              return SendDialog( //调用对话框
+                childCallback: (val) {
 
                 },
               );

+ 116 - 0
lib/send_dialog.dart

@@ -0,0 +1,116 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_screenutil/flutter_screenutil.dart';
+// ignore: must_be_immutable
+class SendDialog extends Dialog {
+  final childCallback;
+
+  SendDialog({
+    Key key,
+    @required this.childCallback
+  }): super(key: key);
+
+  @override
+  Widget build(BuildContext context) {
+    return new Material( //创建透明层
+      type: MaterialType.transparency, //透明类型
+      child: new Center( //保证控件居中效果
+        child: Container(
+          width: ScreenUtil.getInstance().setWidth(554),
+          height: ScreenUtil.getInstance().setHeight(345),
+          decoration: BoxDecoration(
+            color: Colors.white,
+            borderRadius: BorderRadius.all(Radius.circular(8))
+          ),
+          child: new Container(
+            child: new Column(
+              children: < Widget > [
+                Container(
+                  height: ScreenUtil.getInstance().setHeight(255),
+                  decoration: BoxDecoration(
+                    border: Border(bottom: BorderSide(width: 1, color: Color.fromRGBO(151, 151, 151, 0.27)))
+                  ),
+                  child: Center(
+                    child:Column(
+                      mainAxisAlignment: MainAxisAlignment.center,
+                      children: <Widget>[
+                         Text('订单提交成功!', style: TextStyle(
+                            fontSize: ScreenUtil.getInstance().setSp(32)
+                          ), ),
+                          Padding(
+                            padding: EdgeInsets.only(top: 10),
+                            child:Text('订单号:123456789123456', style: TextStyle(
+                            fontSize: ScreenUtil.getInstance().setSp(28),
+                            color: Colors.grey
+                          ), )
+                          )
+                      ],
+                    )
+                    
+                  ),
+                ),
+                Expanded(
+                  flex: 1,
+                  child: Container(
+                    child: Row(
+                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                      children: < Widget > [
+                        Expanded(
+                          flex: 1,
+                          child: InkWell(
+                            child: Container(
+                              decoration: BoxDecoration(
+                                border: Border(right: BorderSide(width: 1, color: Color.fromRGBO(151, 151, 151, 0.27))),
+
+                              ),
+                              child: Center(
+                                child: Text('查看订单',
+                                  style: TextStyle(
+                                    fontSize: ScreenUtil.getInstance().setSp(32),
+                                    color: Color.fromRGBO(64, 98, 254, 1)
+                                  ), ),
+                              )
+
+                            ),
+                            onTap: () {
+                              Navigator.pop(context);
+                            },
+                          )
+                        ),
+                        Expanded(
+                          flex: 1,
+                          child: InkWell(
+                            child: Container(
+                              decoration: BoxDecoration(
+                                border: Border(right: BorderSide(width: 1, color: Color.fromRGBO(151, 151, 151, 0.27))),
+
+                              ),
+                              child: Center(
+                                child: Text('再下一单',
+                                  style: TextStyle(
+                                    fontSize: ScreenUtil.getInstance().setSp(32),
+                                    color: Color.fromRGBO(64, 98, 254, 1)
+                                  ), ),
+                              )
+                            ),
+                            onTap: (){
+                               Navigator.pop(context);
+                              childCallback(true);
+                            },
+                          )
+
+                        ),
+                      ],
+                    ),
+                  )
+
+
+                )
+
+              ],
+            ),
+          ),
+        ),
+      ),
+    );
+  }
+}