send_dialog.dart 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_screenutil/flutter_screenutil.dart';
  3. // ignore: must_be_immutable
  4. class SendDialog extends Dialog{
  5. final orderNo;
  6. final childCallback;
  7. SendDialog({
  8. Key key,
  9. @required this.orderNo,
  10. @required this.childCallback
  11. }): super(key: key);
  12. @override
  13. Widget build(BuildContext context) {
  14. return new Material( //创建透明层
  15. type: MaterialType.transparency, //透明类型
  16. child: new Center( //保证控件居中效果
  17. child: Container(
  18. width: ScreenUtil.getInstance().setWidth(554),
  19. height: ScreenUtil.getInstance().setHeight(345),
  20. decoration: BoxDecoration(
  21. color: Colors.white,
  22. borderRadius: BorderRadius.all(Radius.circular(8))
  23. ),
  24. child: new Container(
  25. child: new Column(
  26. children: < Widget > [
  27. Container(
  28. height: ScreenUtil.getInstance().setHeight(255),
  29. decoration: BoxDecoration(
  30. border: Border(bottom: BorderSide(width: 1, color: Color.fromRGBO(151, 151, 151, 0.27)))
  31. ),
  32. child: Center(
  33. child:Column(
  34. mainAxisAlignment: MainAxisAlignment.center,
  35. children: <Widget>[
  36. Text('订单提交成功!', style: TextStyle(
  37. fontSize: ScreenUtil.getInstance().setSp(32)
  38. ), ),
  39. Padding(
  40. padding: EdgeInsets.only(top: 10),
  41. child:Text('订单号:${orderNo}', style: TextStyle(
  42. fontSize: ScreenUtil.getInstance().setSp(28),
  43. color: Colors.grey
  44. ), )
  45. )
  46. ],
  47. )
  48. ),
  49. ),
  50. Expanded(
  51. flex: 1,
  52. child: Container(
  53. child: Row(
  54. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  55. children: < Widget > [
  56. Expanded(
  57. flex: 1,
  58. child: InkWell(
  59. child: Container(
  60. decoration: BoxDecoration(
  61. border: Border(right: BorderSide(width: 1, color: Color.fromRGBO(151, 151, 151, 0.27))),
  62. ),
  63. child: Center(
  64. child: Text('查看订单',
  65. style: TextStyle(
  66. fontSize: ScreenUtil.getInstance().setSp(32),
  67. color: Color.fromRGBO(64, 98, 254, 1)
  68. ), ),
  69. )
  70. ),
  71. onTap: () {
  72. Navigator.pop(context);
  73. childCallback(false);
  74. },
  75. )
  76. ),
  77. Expanded(
  78. flex: 1,
  79. child: InkWell(
  80. child: Container(
  81. decoration: BoxDecoration(
  82. border: Border(right: BorderSide(width: 1, color: Color.fromRGBO(151, 151, 151, 0.27))),
  83. ),
  84. child: Center(
  85. child: Text('再下一单',
  86. style: TextStyle(
  87. fontSize: ScreenUtil.getInstance().setSp(32),
  88. color: Color.fromRGBO(64, 98, 254, 1)
  89. ), ),
  90. )
  91. ),
  92. onTap: (){
  93. Navigator.pop(context);
  94. childCallback(true);
  95. },
  96. )
  97. ),
  98. ],
  99. ),
  100. )
  101. )
  102. ],
  103. ),
  104. ),
  105. ),
  106. ),
  107. );
  108. }
  109. }