means_list.dart 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. import 'package:flutter/material.dart';
  2. import 'package:liftmanager/internal/search/search_router.dart';
  3. import 'package:liftmanager/widgets/app_search_bar.dart';
  4. import 'package:liftmanager/res/resources.dart';
  5. import 'package:liftmanager/routers/fluro_navigator.dart';
  6. import 'package:liftmanager/widgets/load_image.dart';
  7. import 'package:liftmanager/internal/bbs/bbs_router.dart';
  8. class MeansList extends StatefulWidget {
  9. // QuestionList(this.index);
  10. // final String index;
  11. @override
  12. State<StatefulWidget> createState() {
  13. return MeansListState();
  14. }
  15. }
  16. class MeansListState extends State<MeansList> {
  17. // NewsDetailItem item = NewsDetailItem();
  18. ScrollController _scrollController = new ScrollController();
  19. @override
  20. void dispose() {
  21. _scrollController.dispose();
  22. super.dispose();
  23. }
  24. @override
  25. Widget build(BuildContext context) {
  26. double width = MediaQuery.of(context).size.width;
  27. return Scaffold(
  28. appBar: SearchAppBar(
  29. onPressed: () {
  30. NavigatorUtils.push(context, SearchRouter.searchPage);
  31. }
  32. ),
  33. body:Container(
  34. child:ListView(
  35. children: <Widget>[
  36. Container(
  37. child:HotProduct()
  38. )
  39. ]
  40. ),
  41. ),
  42. );
  43. }
  44. }
  45. class HotProduct extends StatelessWidget {
  46. // const HotProduct({Key key}) : super(key: key);
  47. static const productList = [
  48. {
  49. "brand":"三菱电梯",
  50. "title":"别墅电梯控制器",
  51. "pic":"temporary/product1",
  52. "name":"上海三菱电梯",
  53. "phone":"027-88888888",
  54. },
  55. {
  56. "brand":"奥的斯",
  57. "title":"家用电梯报警盒",
  58. "pic":"temporary/product2",
  59. "name":"奥的斯中国供应",
  60. "phone":"027-88888888",
  61. },
  62. {
  63. "brand":"三菱电梯",
  64. "title":"别墅电梯控制器",
  65. "pic":"temporary/product1",
  66. "name":"上海三菱电梯",
  67. "phone":"027-88888888",
  68. },
  69. {
  70. "brand":"奥的斯",
  71. "title":"家用电梯报警盒",
  72. "pic":"temporary/product2",
  73. "name":"奥的斯中国供应",
  74. "phone":"027-88888888",
  75. },
  76. {
  77. "brand":"三菱电梯",
  78. "title":"别墅电梯控制器",
  79. "pic":"temporary/product1",
  80. "name":"上海三菱电梯",
  81. "phone":"027-88888888",
  82. },
  83. {
  84. "brand":"奥的斯",
  85. "title":"家用电梯报警盒",
  86. "pic":"temporary/product2",
  87. "name":"奥的斯中国供应",
  88. "phone":"027-88888888",
  89. },
  90. {
  91. "brand":"三菱电梯",
  92. "title":"别墅电梯控制器",
  93. "pic":"temporary/product1",
  94. "name":"上海三菱电梯",
  95. "phone":"027-88888888",
  96. },
  97. {
  98. "brand":"奥的斯",
  99. "title":"家用电梯报警盒",
  100. "pic":"temporary/product2",
  101. "name":"奥的斯中国供应",
  102. "phone":"027-88888888",
  103. },
  104. {
  105. "brand":"三菱电梯",
  106. "title":"别墅电梯控制器",
  107. "pic":"temporary/product1",
  108. "name":"上海三菱电梯",
  109. "phone":"027-88888888",
  110. },
  111. {
  112. "brand":"奥的斯",
  113. "title":"家用电梯报警盒",
  114. "pic":"temporary/product2",
  115. "name":"奥的斯中国供应",
  116. "phone":"027-88888888",
  117. },
  118. ];
  119. List<Widget> listWidget(context) => productList.map((i){
  120. return InkWell(
  121. child:Container(
  122. padding: EdgeInsets.only(left:15,right:15,top:10,bottom:10),
  123. decoration: BoxDecoration(
  124. border: Border(
  125. bottom: BorderSide(width: 0.5, color: Colours.line),
  126. ),
  127. ),
  128. child: Row(
  129. crossAxisAlignment: CrossAxisAlignment.start,
  130. children:<Widget>[
  131. ClipRRect(
  132. borderRadius: BorderRadius.circular(5),
  133. child: Container(
  134. padding: EdgeInsets.only(right:10),
  135. child: LoadAssetImage(
  136. i["pic"],
  137. // fit: BoxFit.cover,
  138. width: 100,
  139. height: 100,
  140. ),
  141. ),
  142. ),
  143. Column(
  144. crossAxisAlignment: CrossAxisAlignment.start,
  145. children: <Widget>[
  146. Text(
  147. i["title"],
  148. textAlign: TextAlign.left,
  149. style: TextStyle(
  150. fontSize:16,
  151. color:Color(0xff333333),
  152. ),
  153. ),
  154. Text(
  155. i["brand"],
  156. textAlign: TextAlign.left,
  157. style: TextStyle(
  158. fontSize:15,
  159. color:Color(0xff999999),
  160. ),
  161. ),
  162. Text(
  163. "供应商:${i["name"]}",
  164. textAlign: TextAlign.left,
  165. style: TextStyle(
  166. fontSize:15,
  167. color:Color(0xff999999),
  168. ),
  169. ),
  170. Text(
  171. "Tel:${i["phone"]}",
  172. textAlign: TextAlign.left,
  173. style: TextStyle(
  174. fontSize:15,
  175. color:Color(0xff999999),
  176. ),
  177. ),
  178. ],
  179. ),
  180. ]
  181. ),
  182. ),
  183. onTap: (){
  184. print(i);
  185. NavigatorUtils.push(context, BbsRouter.productDetail);
  186. },
  187. );
  188. }).toList();
  189. @override
  190. Widget build(BuildContext context) {
  191. return Container(
  192. color: Colors.white,
  193. child: Column(
  194. children:listWidget(context)
  195. ),
  196. );
  197. }
  198. }