send_dialog.dart 4.3 KB

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