123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217 |
- import 'package:flutter/material.dart';
- import 'package:liftmanager/res/gaps.dart';
- import 'package:liftmanager/net/api_service.dart';
- import 'package:liftmanager/utils/toast.dart';
- import 'package:liftmanager/widgets/app_bar.dart';
- import 'package:liftmanager/internal/search/search_router.dart';
- import 'package:liftmanager/widgets/app_search_bar.dart';
- import 'package:liftmanager/res/resources.dart';
- import 'package:liftmanager/routers/fluro_navigator.dart';
- import 'package:liftmanager/widgets/load_image.dart';
- import 'package:liftmanager/internal/bbs/bbs_router.dart';
- class MeansList extends StatefulWidget {
- // QuestionList(this.index);
- // final String index;
-
- @override
- State<StatefulWidget> createState() {
- return MeansListState();
- }
- }
- class MeansListState extends State<MeansList> {
- // NewsDetailItem item = NewsDetailItem();
-
- ScrollController _scrollController = new ScrollController();
- @override
- void dispose() {
- _scrollController.dispose();
- super.dispose();
- }
- @override
- Widget build(BuildContext context) {
- double width = MediaQuery.of(context).size.width;
- return Scaffold(
- appBar: SearchAppBar(
- onPressed: () {
- NavigatorUtils.push(context, SearchRouter.searchPage);
- }
- ),
- body:Container(
- child:ListView(
- children: <Widget>[
- Container(
- child:HotProduct()
- )
- ]
- ),
- ),
- );
- }
- }
- class HotProduct extends StatelessWidget {
- // const HotProduct({Key key}) : super(key: key);
- static const productList = [
- {
- "brand":"三菱电梯",
- "title":"别墅电梯控制器",
- "pic":"temporary/product1",
- "name":"上海三菱电梯",
- "phone":"027-88888888",
- },
- {
- "brand":"奥的斯",
- "title":"家用电梯报警盒",
- "pic":"temporary/product2",
- "name":"奥的斯中国供应",
- "phone":"027-88888888",
- },
- {
- "brand":"三菱电梯",
- "title":"别墅电梯控制器",
- "pic":"temporary/product1",
- "name":"上海三菱电梯",
- "phone":"027-88888888",
- },
- {
- "brand":"奥的斯",
- "title":"家用电梯报警盒",
- "pic":"temporary/product2",
- "name":"奥的斯中国供应",
- "phone":"027-88888888",
- },
- {
- "brand":"三菱电梯",
- "title":"别墅电梯控制器",
- "pic":"temporary/product1",
- "name":"上海三菱电梯",
- "phone":"027-88888888",
- },
- {
- "brand":"奥的斯",
- "title":"家用电梯报警盒",
- "pic":"temporary/product2",
- "name":"奥的斯中国供应",
- "phone":"027-88888888",
- },
- {
- "brand":"三菱电梯",
- "title":"别墅电梯控制器",
- "pic":"temporary/product1",
- "name":"上海三菱电梯",
- "phone":"027-88888888",
- },
- {
- "brand":"奥的斯",
- "title":"家用电梯报警盒",
- "pic":"temporary/product2",
- "name":"奥的斯中国供应",
- "phone":"027-88888888",
- },
- {
- "brand":"三菱电梯",
- "title":"别墅电梯控制器",
- "pic":"temporary/product1",
- "name":"上海三菱电梯",
- "phone":"027-88888888",
- },
- {
- "brand":"奥的斯",
- "title":"家用电梯报警盒",
- "pic":"temporary/product2",
- "name":"奥的斯中国供应",
- "phone":"027-88888888",
- },
- ];
- List<Widget> listWidget(context) => productList.map((i){
- return InkWell(
- child:Container(
- padding: EdgeInsets.only(left:15,right:15,top:10,bottom:10),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(width: 0.5, color: Colours.line),
- ),
- ),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children:<Widget>[
- ClipRRect(
- borderRadius: BorderRadius.circular(5),
- child: Container(
- padding: EdgeInsets.only(right:10),
- child: LoadAssetImage(
- i["pic"],
- // fit: BoxFit.cover,
- width: 100,
- height: 100,
- ),
- ),
- ),
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- Text(
- i["title"],
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize:16,
- color:Color(0xff333333),
- ),
- ),
- Text(
- i["brand"],
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize:15,
- color:Color(0xff999999),
- ),
- ),
- Text(
- "供应商:${i["name"]}",
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize:15,
- color:Color(0xff999999),
- ),
- ),
- Text(
- "Tel:${i["phone"]}",
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize:15,
- color:Color(0xff999999),
- ),
- ),
- ],
- ),
- ]
- ),
- ),
- onTap: (){
- print(i);
- NavigatorUtils.push(context, BbsRouter.productDetail);
- },
- );
- }).toList();
- @override
- Widget build(BuildContext context) {
- return Container(
- color: Colors.white,
- child: Column(
- children:listWidget(context)
- ),
- );
- }
- }
|