means_list.dart 6.0 KB

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