OrderListCard.dart 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_screenutil/flutter_screenutil.dart';
  3. import 'package:get/get.dart';
  4. import '../models/entities/OrderListAll.dart';
  5. import '../pages/OrderConfirmation/index.dart';
  6. import '../pages/orderInfo/index.dart';
  7. import 'LinearGradientText.dart';
  8. class OrderListCard extends StatefulWidget {
  9. final OrderListAll item;
  10. const OrderListCard({Key? key, required this.item}) : super(key: key);
  11. @override
  12. _OrderListCardPages createState() => _OrderListCardPages(item);
  13. }
  14. class _OrderListCardPages extends State<OrderListCard> {
  15. final OrderListAll item;
  16. _OrderListCardPages(this.item);
  17. @override
  18. Widget build(BuildContext context) {
  19. return Container(
  20. width: 375.w,
  21. height: 345.h,
  22. margin: EdgeInsets.fromLTRB(0, 0, 0, 20),
  23. decoration: const BoxDecoration(color: Colors.white, boxShadow: [
  24. BoxShadow(
  25. color: Colors.black12,
  26. offset: Offset(0.0, 15.0), //阴影xy轴偏移量
  27. blurRadius: 15.0, //阴影模糊程度
  28. spreadRadius: 1.0 //阴影扩散程度
  29. )
  30. ]),
  31. child: Row(
  32. crossAxisAlignment: CrossAxisAlignment.start,
  33. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  34. children: [
  35. Container(
  36. margin: EdgeInsets.fromLTRB(15, 20, 15, 0),
  37. width: 18.0,
  38. height: 275.h,
  39. child: Image(
  40. image: AssetImage('images/ordersLeft.png'),
  41. ),
  42. ),
  43. Expanded(
  44. child: Column(
  45. crossAxisAlignment: CrossAxisAlignment.start,
  46. children: [
  47. Container(
  48. width: 320.w,
  49. margin: EdgeInsets.fromLTRB(0, 10, 0, 15),
  50. padding: EdgeInsets.fromLTRB(0, 0, 0, 20),
  51. decoration: const BoxDecoration(
  52. border: Border(
  53. bottom:
  54. BorderSide(width: 0.5, color: Color(0x20000000)
  55. // 0x17000000
  56. ))),
  57. child: Row(
  58. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  59. children: [
  60. Container(
  61. child: RichText(
  62. text: TextSpan(children: <InlineSpan>[
  63. TextSpan(
  64. text: '订单编号:',
  65. style: TextStyle(
  66. color: Color(0xff666666),
  67. fontSize: 16,
  68. fontWeight: FontWeight.bold)),
  69. TextSpan(
  70. text: item.orderNo,
  71. style: TextStyle(
  72. color: Color(0xff222222),
  73. fontSize: 16,
  74. fontWeight: FontWeight.bold)),
  75. ]),
  76. ),
  77. ),
  78. GestureDetector(
  79. child: const Text('详情 >>',
  80. style: TextStyle(
  81. color: Color(0xff222222),
  82. fontSize: 16,
  83. fontWeight: FontWeight.bold,
  84. )),
  85. onTap: () {
  86. print('进入详情');
  87. Get.to(OrderPageInfo());
  88. },
  89. )
  90. ],
  91. ),
  92. ),
  93. Expanded(
  94. child: Column(
  95. crossAxisAlignment: CrossAxisAlignment.start,
  96. children: [
  97. Padding(
  98. padding: EdgeInsets.fromLTRB(0, 0, 0, 15),
  99. child: RichText(
  100. text: TextSpan(children: <InlineSpan>[
  101. TextSpan(
  102. text: '农机名称:',
  103. style: TextStyle(
  104. color: Color(0xff666666),
  105. fontSize: 16,
  106. fontWeight: FontWeight.bold)),
  107. TextSpan(
  108. text: item.machineryName,
  109. style: TextStyle(
  110. color: Color(0xff222222),
  111. fontSize: 16,
  112. fontWeight: FontWeight.bold)),
  113. ]),
  114. ),
  115. ),
  116. Padding(
  117. padding: EdgeInsets.fromLTRB(0, 0, 0, 15),
  118. child: RichText(
  119. text: TextSpan(children: <InlineSpan>[
  120. TextSpan(
  121. text: '作业面积:',
  122. style: TextStyle(
  123. color: Color(0xff666666),
  124. fontSize: 16,
  125. fontWeight: FontWeight.bold)),
  126. TextSpan(
  127. text: item.amount.toString(),
  128. style: TextStyle(
  129. color: Color(0xff222222),
  130. fontSize: 16,
  131. fontWeight: FontWeight.bold)),
  132. ]),
  133. ),
  134. ),
  135. Padding(
  136. padding: EdgeInsets.fromLTRB(0, 0, 0, 15),
  137. child: RichText(
  138. text: TextSpan(children: <InlineSpan>[
  139. TextSpan(
  140. text: '需求时间:',
  141. style: TextStyle(
  142. color: Color(0xff666666),
  143. fontSize: 16,
  144. fontWeight: FontWeight.bold)),
  145. TextSpan(
  146. text: item.appointmentDate.toString(),
  147. style: TextStyle(
  148. color: Color(0xff222222),
  149. fontSize: 16,
  150. fontWeight: FontWeight.bold)),
  151. ]),
  152. ),
  153. ),
  154. Padding(
  155. padding: EdgeInsets.fromLTRB(0, 0, 0, 4),
  156. child: RichText(
  157. text: TextSpan(children: <InlineSpan>[
  158. TextSpan(
  159. text: '下单时间:',
  160. style: TextStyle(
  161. color: Color(0xff666666),
  162. fontSize: 16,
  163. fontWeight: FontWeight.bold)),
  164. TextSpan(
  165. text: item.createDate.toString(),
  166. style: TextStyle(
  167. color: Color(0xff222222),
  168. fontSize: 16,
  169. fontWeight: FontWeight.bold)),
  170. ]),
  171. ),
  172. ),
  173. ],
  174. )),
  175. Container(
  176. margin: EdgeInsets.fromLTRB(0, 0, 0, 30),
  177. padding: EdgeInsets.fromLTRB(0, 20, 0, 0),
  178. decoration: const BoxDecoration(
  179. border: Border(
  180. top: BorderSide(
  181. width: 0.5, color: Color(0x20000000)))),
  182. width: 320.w,
  183. child: Row(
  184. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  185. children: [
  186. RichText(
  187. text: const TextSpan(children: <InlineSpan>[
  188. TextSpan(
  189. text: '订单状态:',
  190. style: TextStyle(
  191. color: Color(0xff666666),
  192. fontSize: 16,
  193. fontWeight: FontWeight.bold)),
  194. TextSpan(
  195. text: '待付款',
  196. style: TextStyle(
  197. color: Color(0xff51D4FF),
  198. fontSize: 16,
  199. fontWeight: FontWeight.bold)),
  200. ]),
  201. ),
  202. Container(
  203. child: Row(
  204. children: [
  205. const Text('费用:',style: TextStyle(
  206. color: Color(0xff666666),
  207. fontSize: 16,
  208. fontWeight: FontWeight.bold)),
  209. LinearGradientText(
  210. colors: const <Color>[
  211. Color(0xFFFA7878),
  212. Color(0xFFB61515),
  213. ],
  214. child: RichText(
  215. text: TextSpan(
  216. children: <InlineSpan>[
  217. TextSpan(
  218. text:( item.charges!/100).toString(),
  219. style: TextStyle(
  220. fontSize: 16,
  221. fontWeight: FontWeight.bold,
  222. )),
  223. TextSpan(
  224. text: "元",
  225. style: TextStyle(
  226. fontSize: 16,
  227. fontWeight: FontWeight.bold,
  228. )),
  229. ]
  230. ),
  231. ),
  232. ),
  233. ],
  234. ),
  235. ),
  236. ],
  237. ),
  238. ),
  239. ],
  240. ),
  241. ),
  242. ],
  243. ),
  244. );
  245. }
  246. }