123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. import 'package:farmer_client/widgets/DefaultButton.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:flutter_screenutil/flutter_screenutil.dart';
  4. import 'package:fluttertoast/fluttertoast.dart';
  5. import 'package:get/get.dart';
  6. import '../../widgets/OrderInfoCard.dart';
  7. class OrderPageInfo extends StatefulWidget {
  8. const OrderPageInfo({Key? key}) : super(key: key);
  9. @override
  10. State<OrderPageInfo> createState() => _OrderPageInfoState();
  11. }
  12. class _OrderPageInfoState extends State<OrderPageInfo> {
  13. void onCancel() {
  14. showDialog(
  15. context: context,
  16. builder: (context) {
  17. return AlertDialog(content: Text("您确定要取消订单吗?"), actions: <Widget>[
  18. TextButton(
  19. child: Text("取消"),
  20. onPressed: () {
  21. print("取消");
  22. Navigator.pop(context, 'Cancle');
  23. },
  24. ),
  25. TextButton(
  26. child: Text("确定"),
  27. onPressed: () {
  28. // setState(() {
  29. // addressList.remove(addressList[e]);
  30. // });
  31. Navigator.pop(context, "Ok");
  32. Fluttertoast.showToast(msg: '取消成功!');
  33. Get.offAllNamed('/');
  34. })
  35. ]);
  36. });
  37. }
  38. @override
  39. Widget build(BuildContext context) {
  40. return Scaffold(
  41. resizeToAvoidBottomInset: false,
  42. appBar: AppBar(
  43. elevation: 0,
  44. centerTitle: true,
  45. backgroundColor: Colors.white,
  46. title: Text(
  47. '订单详情',
  48. style: TextStyle(
  49. color: Colors.black,
  50. fontSize: 17.sp,
  51. letterSpacing: 2,
  52. fontWeight: FontWeight.bold),
  53. ),
  54. ),
  55. body: Column(
  56. children: [
  57. OrderInfoCard(),
  58. Spacer(),
  59. Container(
  60. margin: EdgeInsets.fromLTRB(15.w, 0, 15.w, 50.h),
  61. child: Row(
  62. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  63. children: [
  64. GestureDetector(
  65. onTap: () {
  66. onCancel();
  67. },
  68. child: Container(
  69. width: 150.w,
  70. height: 49.h,
  71. decoration: BoxDecoration(
  72. color: const Color(0xffffffff),
  73. border: Border.all(
  74. color: const Color(0xFFFF703B),
  75. width: 1.w,
  76. style: BorderStyle.solid),
  77. borderRadius:
  78. BorderRadius.all(Radius.circular(24.5.w))),
  79. child: Center(
  80. child: Text(
  81. '取消',
  82. style: TextStyle(
  83. fontSize: 20.sp,
  84. color: const Color(0xFFFF703B),
  85. fontWeight: FontWeight.bold),
  86. ),
  87. ),
  88. ),
  89. ),
  90. DefaultButton(
  91. color: const Color(0xffffffff),
  92. backColor: const Color(0xFFFF703B),
  93. width: 150.w,
  94. height: 49.h,
  95. text: '支付',
  96. onPressed: () {
  97. Fluttertoast.showToast(msg: '支付成功!');
  98. Get.offAllNamed('/');
  99. },
  100. margin: const EdgeInsets.all(0),
  101. fontSize: 20.sp,
  102. radius: 24.5.w,
  103. ),
  104. ],
  105. ),
  106. ),
  107. // Container(
  108. // height: 130.h,
  109. // margin: EdgeInsets.only(top: 20.0, bottom: 0.0),
  110. // alignment: Alignment.bottomCenter,
  111. // child: SizedBox(
  112. // width: 315.w,
  113. // height: 49.h,
  114. // child: ElevatedButton(
  115. // onPressed: () {
  116. // // _handelSubmit();
  117. // print('用户点击了支付啊阿松大撒地方');
  118. // },
  119. // child: const Text(
  120. // "支付",
  121. // style: TextStyle(
  122. // fontSize: 18,
  123. // color: Colors.white,
  124. // fontWeight: FontWeight.bold),
  125. // ),
  126. // style: ButtonStyle(
  127. // elevation: MaterialStateProperty.all(0),
  128. // backgroundColor:
  129. // MaterialStateProperty.all(const Color(0xFFFF703B)),
  130. // shape: MaterialStateProperty.all(const RoundedRectangleBorder(
  131. // borderRadius: BorderRadius.all(Radius.circular(24.4)))),
  132. // ),
  133. // ),
  134. // ),
  135. // ),
  136. ],
  137. ),
  138. );
  139. }
  140. }