import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:liftmanager/res/resources.dart';
import 'package:liftmanager/widgets/app_bar.dart';
import 'package:liftmanager/widgets/load_image.dart';

class RecommendExit extends StatefulWidget {
  RecommendExit(this.id);

  final String id;
  

  @override
  State<StatefulWidget> createState() {
    return RecommendExitState();
  }
}

class RecommendExitState extends State<RecommendExit> {
  // NewsDetailItem item = NewsDetailItem();
  
  ScrollController _scrollController = new ScrollController();


  @override
  Widget build(BuildContext context) {

    double width = MediaQuery.of(context).size.width;

    

    return Scaffold(
      resizeToAvoidBottomPadding: false,//不让键盘弹上去
      appBar: MyAppBar(
        centerTitle: "出诊推荐",
      ),
      body:Stack(
        children:<Widget>[
          Container(
            padding: EdgeInsets.only(bottom:ScreenUtil().setWidth(70)),
        child: ListView(
          children: <Widget>[
            Column(
              crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            Container(
              padding: EdgeInsets.only(left:ScreenUtil().setWidth(15),right:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10),bottom:ScreenUtil().setWidth(10)),
              decoration: BoxDecoration(
                border: Border(
                  bottom: BorderSide(width: 0.5, color: Colours.line),
                ),
              ),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children:<Widget>[
                  Text(
                    "提问人",
                    style: TextStyle(
                      color:Color(0xff333333),
                      fontSize:ScreenUtil().setSp(17)
                    ),
                    textAlign:TextAlign.start,
                  ),
                  Row(
                    children: <Widget>[
                      Text(
                        "小小维修工",
                        style: TextStyle(
                          color:Color(0xff666666),
                          fontSize:ScreenUtil().setSp(15)
                        ),
                        textAlign:TextAlign.start,
                      ),
                      Container(
                                margin: EdgeInsets.only(left:ScreenUtil().setWidth(10),right:ScreenUtil().setWidth(10),top:ScreenUtil().setWidth(5)),
                                decoration: BoxDecoration(
                                  borderRadius: BorderRadius.circular(ScreenUtil().setWidth(25)),
                                ),
                                child: LoadAssetImage(
                                  // image: AssetImage(i['img']),
                                  "temporary/avator1",
                                  width: ScreenUtil().setWidth(37),
                                  height:ScreenUtil().setWidth(37),
                                  // alignment: Alignment.centerLeft,
                                ),
                              ),
                    ],
                  )
                ]
              ),
            ),
            Container(
              padding: EdgeInsets.only(left:ScreenUtil().setWidth(15),right:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10),bottom:ScreenUtil().setWidth(10)),
              decoration: BoxDecoration(
                border: Border(
                  bottom: BorderSide(width: 0.5, color: Colours.line),
                ),
              ),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children:<Widget>[
                  Text(
                    "电梯品牌",
                    style: TextStyle(
                      color:Color(0xff333333),
                      fontSize:ScreenUtil().setSp(17)
                    ),
                    textAlign:TextAlign.start,
                  ),
                  Text(
                    "奥的斯",
                    style: TextStyle(
                      color:Color(0xff666666),
                      fontSize:ScreenUtil().setSp(15)
                    ),
                    textAlign:TextAlign.start,
                  ),
                ]
              ),
            ),
            Container(
              padding: EdgeInsets.only(left:ScreenUtil().setWidth(15),right:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10),bottom:ScreenUtil().setWidth(10)),
              decoration: BoxDecoration(
                border: Border(
                  bottom: BorderSide(width: 0.5, color: Colours.line),
                ),
              ),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children:<Widget>[
                  Text(
                    "出诊时间",
                    style: TextStyle(
                      color:Color(0xff333333),
                      fontSize:ScreenUtil().setSp(17)
                    ),
                    textAlign:TextAlign.start,
                  ),
                  Text(
                    "2020-02-20 12:30",
                    style: TextStyle(
                      color:Color(0xff666666),
                      fontSize:ScreenUtil().setSp(15)
                    ),
                    textAlign:TextAlign.start,
                  ),
                ]
              ),
            ),
            Container(
              padding: EdgeInsets.only(left:ScreenUtil().setWidth(15),right:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10),bottom:ScreenUtil().setWidth(10)),
              decoration: BoxDecoration(
                border: Border(
                  bottom: BorderSide(width: 0.5, color: Colours.line),
                ),
              ),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children:<Widget>[
                  Text(
                    "出诊地点",
                    style: TextStyle(
                      color:Color(0xff333333),
                      fontSize:ScreenUtil().setSp(17)
                    ),
                    textAlign:TextAlign.start,
                  ),
                  Text(
                    "创业大厦E座",
                    style: TextStyle(
                      color:Color(0xff666666),
                      fontSize:ScreenUtil().setSp(15)
                    ),
                    textAlign:TextAlign.start,
                  ),
                ]
              ),
            ),
            
            Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              mainAxisAlignment: MainAxisAlignment.start,
              children: <Widget>[
                Container(
                  padding:EdgeInsets.only(left:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10),bottom:ScreenUtil().setWidth(5)),
                  child: Text(
                    "问题描述",
                    style: TextStyle(
                          color:Color(0xff333333),
                          fontSize:ScreenUtil().setSp(17),
                          
                    ),
                    textAlign:TextAlign.left,
                  ),
                ),
                Container(
                  padding: EdgeInsets.only(left:ScreenUtil().setWidth(15),right:ScreenUtil().setWidth(15),bottom:ScreenUtil().setWidth(50)),
                  child: Text(
                        "重启闸门，还是没有解决",
                        style: TextStyle(
                              color:Color(0xff666666),
                              fontSize:ScreenUtil().setSp(15),
                              
                        ),
                        textAlign:TextAlign.left,
                      ),
                ),
              ],
            ),
            
            SizedBox(
              height:6,
              child: Container(
                color:Color(0xFFF8F8F8)
              ),
            ),
            Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              mainAxisAlignment: MainAxisAlignment.start,
              children: <Widget>[
                Container(
                  padding:EdgeInsets.only(left:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10),bottom:ScreenUtil().setWidth(5)),
                  child: Text(
                    "已尝试方法",
                    style: TextStyle(
                          color:Color(0xff333333),
                          fontSize:ScreenUtil().setSp(17),
                          
                    ),
                    textAlign:TextAlign.left,
                  ),
                ),
                Container(
                  padding: EdgeInsets.only(left:ScreenUtil().setWidth(15),right:ScreenUtil().setWidth(15),bottom:ScreenUtil().setWidth(50)),
                  child: Text(
                        "重启闸门，还是没有解决",
                        style: TextStyle(
                              color:Color(0xff666666),
                              fontSize:ScreenUtil().setSp(15),
                              
                        ),
                        textAlign:TextAlign.left,
                      ),
                ),
              ],
            ),
            
            SizedBox(
              height:6,
              child: Container(
                color:Color(0xFFF8F8F8)
              ),
            ),
            Container(
              padding: EdgeInsets.all(15),
              color: Colors.white,
              child: Wrap(
                spacing: 15,
                runSpacing : 15,
                children:<Widget>[
                  LoadAssetImage(
                    "temporary/product1",
                    width: ScreenUtil().setWidth(70),
                    height:ScreenUtil().setWidth(70),
                    // alignment: Alignment.centerLeft,
                  ),
                  LoadAssetImage(
                    "temporary/product1",
                    width: ScreenUtil().setWidth(70),
                    height:ScreenUtil().setWidth(70),
                    // alignment: Alignment.centerLeft,
                  ),
                  LoadAssetImage(
                    "temporary/product1",
                    width: ScreenUtil().setWidth(70),
                    height:ScreenUtil().setWidth(70),
                    // alignment: Alignment.centerLeft,
                  ),
                  LoadAssetImage(
                    "temporary/product1",
                    width: ScreenUtil().setWidth(70),
                    height:ScreenUtil().setWidth(70),
                    // alignment: Alignment.centerLeft,
                  ),
                  LoadAssetImage(
                    "temporary/product1",
                    width: ScreenUtil().setWidth(70),
                    height:ScreenUtil().setWidth(70),
                    // alignment: Alignment.centerLeft,
                  ),
                  LoadAssetImage(
                    "temporary/product1",
                    width: ScreenUtil().setWidth(70),
                    height:ScreenUtil().setWidth(70),
                    // alignment: Alignment.centerLeft,
                  ),
                  LoadAssetImage(
                    "temporary/product1",
                    width: ScreenUtil().setWidth(70),
                    height:ScreenUtil().setWidth(70),
                    // alignment: Alignment.centerLeft,
                  ),
                  LoadAssetImage(
                    "temporary/product1",
                    width: ScreenUtil().setWidth(70),
                    height:ScreenUtil().setWidth(70),
                    // alignment: Alignment.centerLeft,
                  ),
                ]
              )
            ),
            
          ],
        ),
          ]
        )
        
      ),
      Positioned(
              bottom:0,
              left:0,
              child:Container(
                width: width,
                child: Row(
                  children:<Widget>[
                    
                    Container(
                      height:ScreenUtil().setWidth(70),
                      width:width/2,
                      color: Colors.white,
                      child: FlatButton(
                        // padding: EdgeInsets.all(15.0),
                        child: Text("拒绝",style: TextStyle(fontSize:ScreenUtil().setSp(16)),),
                        textColor: Color(0xff222222),
                        onPressed: () {
                          
                          // NavigatorUtils.push(context, BbsRouter.questionPay);
                          
                          
                        },
                      ),
                    ),
                    Container(
                      height:ScreenUtil().setWidth(70),
                      width:width/2,
                      color: Color(0xff0388FD),
                      child: FlatButton(
                        // padding: EdgeInsets.all(15.0),
                        child: Text("接单",style: TextStyle(fontSize:ScreenUtil().setSp(16)),),
                        textColor: Colors.white,
                        onPressed: () {
                          
                          // NavigatorUtils.push(context, BbsRouter.questionPay);
                          
                          
                        },
                      ),
                    ),
                  ]
                )
              )
            )
        ]
      )
    );
  }
}