123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. import 'package:flutter/foundation.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:flutter_screenutil/flutter_screenutil.dart';
  4. import 'package:get/get.dart';
  5. import 'package:get/get_core/src/get_main.dart';
  6. import '../pages/OrderConfirmation/index.dart';
  7. // class CarItem {
  8. // late String name;
  9. // late num? price;
  10. // late num? distance;
  11. // CarItem({required this.name, this.price, this.distance});
  12. // }
  13. class CarsCard extends StatelessWidget {
  14. // final CarItem item;
  15. // const CarsCard({
  16. // Key? key,
  17. // required this.item,
  18. // }) : super(key: key);
  19. @override
  20. Widget build(BuildContext context) {
  21. return Container(
  22. decoration: BoxDecoration(
  23. color: Color(0xfff2f2f2),
  24. ),
  25. width: 345.w,
  26. // height: 389.h,
  27. child: Column(
  28. children: [
  29. Image.network(
  30. "http://yz-shigongli.oss-accelerate.aliyuncs.com/2022-03/1648094119154-7b280bbf63105a8e90299e2d79c8c6ee.jpeg",
  31. width: 345.w,
  32. height: 230.h,
  33. fit: BoxFit.cover,
  34. ),
  35. Container(
  36. padding: EdgeInsets.fromLTRB(15, 20, 0, 0),
  37. child: Row(
  38. crossAxisAlignment: CrossAxisAlignment.start,
  39. verticalDirection: VerticalDirection.up,
  40. children: <Widget>[
  41. Container(
  42. child: Text(
  43. '联合收割机GB01235-0B',
  44. style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
  45. ),
  46. ),
  47. ],
  48. ),
  49. ),
  50. Container(
  51. padding: const EdgeInsets.fromLTRB(19, 0, 0, 0),
  52. child: Row(
  53. crossAxisAlignment: CrossAxisAlignment.start,
  54. verticalDirection: VerticalDirection.up,
  55. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  56. children: <Widget>[
  57. Container(
  58. child: RichText(
  59. text: const TextSpan(children: <InlineSpan>[
  60. TextSpan(
  61. text: '8555元/',
  62. style: TextStyle(
  63. color: Color(0xffce3800),
  64. fontSize: 22,
  65. fontWeight: FontWeight.bold)),
  66. TextSpan(
  67. text: '公顷',
  68. style: TextStyle(
  69. color: Color(0xffce3800),
  70. fontSize: 10,
  71. fontWeight: FontWeight.bold)),
  72. ]),
  73. ),
  74. ),
  75. Align(
  76. widthFactor: 1.2,
  77. heightFactor: 1.2,
  78. alignment: Alignment(1.2, -5),
  79. child: Container(
  80. margin: EdgeInsets.only(right: 13),
  81. width: 86.w, //+6
  82. height: 44.h, //+10
  83. child: ElevatedButton(
  84. onPressed: () {
  85. Get.to(OrderConfirmation());
  86. print('点我去预约');
  87. },
  88. child: const Text(
  89. "预约",
  90. style: TextStyle(
  91. fontSize: 19,
  92. color: Colors.white,
  93. fontWeight: FontWeight.bold),
  94. ),
  95. style: ButtonStyle(
  96. backgroundColor:
  97. MaterialStateProperty.all(const Color(0xFFFF703B)),
  98. shape: MaterialStateProperty.all(
  99. const RoundedRectangleBorder(
  100. //这个0像素圆角style如果删掉的话,按钮会变成默认样式,自带圆角
  101. borderRadius:
  102. BorderRadius.all(Radius.circular(0)))),
  103. ),
  104. ),
  105. ),
  106. ),
  107. ],
  108. ),
  109. ),
  110. // 地址信息 进入地图
  111. Container(
  112. padding: EdgeInsets.fromLTRB(19, 20, 0, 10),
  113. child: Row(
  114. children: [
  115. Image.asset(
  116. "images/gpsImgae.png",
  117. width: 11.w,
  118. height: 13.h,
  119. fit: BoxFit.cover,
  120. ),
  121. Container(
  122. padding: EdgeInsets.fromLTRB(5, 0, 0, 0),
  123. width: 300.w,
  124. child: Row(
  125. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  126. children: [
  127. Text(
  128. '距离当前位置2.6公里',
  129. style: TextStyle(
  130. fontSize: 15, fontWeight: FontWeight.bold),
  131. ),
  132. GestureDetector(
  133. child: Text(
  134. '进入地图 >>',
  135. style: TextStyle(
  136. fontSize: 15, fontWeight: FontWeight.bold),
  137. ),
  138. onTap: () {
  139. print('进入地图');
  140. },
  141. )
  142. ],
  143. )),
  144. ],
  145. )),
  146. ],
  147. ),
  148. );
  149. }
  150. }