import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
// ignore: must_be_immutable
class SendDialog extends Dialog{
  final orderNo;
  final childCallback;

  SendDialog({
    Key key,
    @required this.orderNo,
    @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('订单号：${orderNo}', 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);
                              childCallback(false);
                            },
                          )
                        ),
                        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);
                            },
                          )

                        ),
                      ],
                    ),
                  )


                )

              ],
            ),
          ),
        ),
      ),
    );
  }
}