OrderInfoCard.dart 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. import 'package:farmer_client/models/entities/OrderInfoModel.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:flutter_screenutil/flutter_screenutil.dart';
  4. import 'package:get/get.dart';
  5. import 'package:intl/intl.dart';
  6. import 'LinearGradientText.dart';
  7. class OrderInfoCard extends StatelessWidget {
  8. final OrderInfoModel item;
  9. final String orderStateText;
  10. final Color orderStateColor;
  11. // final DateTime timeNew=item.appointmentDate;
  12. const OrderInfoCard({Key? key, required this.item, required this.orderStateColor, required this.orderStateText}) : super(key: key);
  13. @override
  14. Widget build(BuildContext context) {
  15. return Container(
  16. width: 345.w,
  17. height: 484.5.h,
  18. margin: EdgeInsets.fromLTRB(15.w, 17.w, 15.w, 0),
  19. decoration: BoxDecoration(
  20. color: Colors.white,
  21. //设置四周圆角 角度
  22. borderRadius: BorderRadius.all(Radius.circular(2.0)),
  23. //设置四周边框
  24. boxShadow: [
  25. BoxShadow(
  26. blurRadius: 10, //阴影范围
  27. spreadRadius: 0.1, //阴影浓度
  28. color: Colors.grey.withOpacity(0.2), //阴影颜色
  29. ),
  30. ],
  31. ),
  32. child: Column(
  33. crossAxisAlignment: CrossAxisAlignment.start,
  34. children: [
  35. Container(
  36. margin: EdgeInsets.fromLTRB(15.w, 0, 0, 0),
  37. child: Column(
  38. crossAxisAlignment: CrossAxisAlignment.start,
  39. children: [
  40. Container(
  41. padding: EdgeInsets.fromLTRB(0, 15, 0, 20),
  42. width: 314.w,
  43. decoration: const BoxDecoration(
  44. border: Border(
  45. bottom: BorderSide(
  46. width: 0.5, color: Color(0x20000000)
  47. // 0x17000000
  48. ))),
  49. child: RichText(
  50. text: TextSpan(children: <InlineSpan>[
  51. TextSpan(
  52. text: '订单编号:',
  53. style: TextStyle(
  54. color: Color(0xff666666),
  55. fontSize: 16,
  56. fontWeight: FontWeight.bold)),
  57. TextSpan(
  58. text: item.orderNo.toString(),
  59. style: TextStyle(
  60. color: Color(0xff222222),
  61. fontSize: 16,
  62. fontWeight: FontWeight.bold)),
  63. ]),
  64. ),
  65. ),
  66. Padding(
  67. padding: EdgeInsets.fromLTRB(0, 20, 0, 15),
  68. child: RichText(
  69. text: TextSpan(children: <InlineSpan>[
  70. TextSpan(
  71. text: '农机名称:',
  72. style: TextStyle(
  73. color: Color(0xff666666),
  74. fontSize: 16,
  75. fontWeight: FontWeight.bold)),
  76. TextSpan(
  77. text: item.machineryName.toString(),
  78. style: TextStyle(
  79. color: Color(0xff222222),
  80. fontSize: 16,
  81. fontWeight: FontWeight.bold)),
  82. ]),
  83. ),
  84. ),
  85. Padding(
  86. padding: EdgeInsets.fromLTRB(0, 0, 0, 15),
  87. child: RichText(
  88. text: TextSpan(children: <InlineSpan>[
  89. TextSpan(
  90. text: '作业面积:',
  91. style: TextStyle(
  92. color: Color(0xff666666),
  93. fontSize: 16,
  94. fontWeight: FontWeight.bold)),
  95. TextSpan(
  96. text: item.amount.toString(),
  97. style: TextStyle(
  98. color: Color(0xff222222),
  99. fontSize: 16,
  100. fontWeight: FontWeight.bold)),
  101. ]),
  102. ),
  103. ),
  104. Padding(
  105. padding: EdgeInsets.fromLTRB(0, 0, 0, 15),
  106. child: RichText(
  107. text: TextSpan(children: <InlineSpan>[
  108. TextSpan(
  109. text: '需求时间:',
  110. style: TextStyle(
  111. color: Color(0xff666666),
  112. fontSize: 16,
  113. fontWeight: FontWeight.bold)),
  114. TextSpan(
  115. // '${DateFormat("yyyy-MM-dd").format(item.appointmentDate.toString())}'
  116. text: DateFormat("yyyy-MM-dd").format(DateTime.parse(item.appointmentDate.toString())),
  117. style: TextStyle(
  118. color: Color(0xff222222),
  119. fontSize: 16,
  120. fontWeight: FontWeight.bold)),
  121. ]),
  122. ),
  123. ),
  124. Padding(
  125. padding: EdgeInsets.fromLTRB(0, 0, 0, 20),
  126. child: RichText(
  127. text: TextSpan(children: <InlineSpan>[
  128. TextSpan(
  129. text: '下单时间:',
  130. style: TextStyle(
  131. color: Color(0xff666666),
  132. fontSize: 16,
  133. fontWeight: FontWeight.bold)),
  134. TextSpan(
  135. text: DateFormat("yyyy-MM-dd").format(DateTime.parse(item.createDate.toString())),
  136. style: TextStyle(
  137. color: Color(0xff222222),
  138. fontSize: 16,
  139. fontWeight: FontWeight.bold)),
  140. ]),
  141. ),
  142. ),
  143. Padding(
  144. padding: EdgeInsets.fromLTRB(0, 0, 0, 20),
  145. child: RichText(
  146. text: TextSpan(children: <InlineSpan>[
  147. TextSpan(
  148. text: '订单状态:',
  149. style: TextStyle(
  150. color: Color(0xff666666),
  151. fontSize: 16,
  152. fontWeight: FontWeight.bold)),
  153. TextSpan(
  154. text: orderStateText,
  155. style: TextStyle(
  156. color:orderStateColor,
  157. fontSize: 16,
  158. fontWeight: FontWeight.bold)),
  159. ]),
  160. ),
  161. ),
  162. Container(
  163. padding: EdgeInsets.fromLTRB(0, 20, 0, 0),
  164. width: 314.w,
  165. decoration: const BoxDecoration(
  166. border: Border(
  167. top: BorderSide(
  168. width: 0.8, color: Color(0x20000000)
  169. // 0x17000000
  170. ))),
  171. child: Column(
  172. children: [
  173. Row(
  174. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  175. children: [
  176. const Text('费用:',
  177. style: TextStyle(
  178. color: Color(0xff666666),
  179. fontSize: 16,
  180. fontWeight: FontWeight.bold)),
  181. LinearGradientText(
  182. colors: const <Color>[
  183. Color(0xFFFA7878),
  184. Color(0xFFB61515),
  185. ],
  186. child: const Text('8880',
  187. style: TextStyle(
  188. color: Color(0xffB61515),
  189. fontSize: 16,
  190. fontWeight: FontWeight.bold)),
  191. ),
  192. ],
  193. ),
  194. Padding(
  195. padding: EdgeInsets.fromLTRB(0, 30, 0, 0),
  196. child: Row(
  197. mainAxisAlignment:
  198. MainAxisAlignment.spaceBetween,
  199. children: [
  200. Text('状态:',
  201. style: TextStyle(
  202. color: Color(0xff666666),
  203. fontSize: 16,
  204. fontWeight: FontWeight.bold)),
  205. Text(orderStateText,
  206. style: TextStyle(
  207. color: orderStateColor,
  208. fontSize: 16,
  209. fontWeight: FontWeight.bold)),
  210. ],
  211. ),
  212. ),
  213. ],
  214. )),
  215. ],
  216. )),
  217. ],
  218. ),
  219. );
  220. }
  221. }