import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:liftmanager/internal/bbs/model/liftcase_model.dart';
import 'package:liftmanager/internal/wode/wode_router.dart';
import 'package:liftmanager/net/api_service.dart';
import 'package:liftmanager/res/resources.dart';
import 'package:liftmanager/routers/fluro_navigator.dart';
import 'package:liftmanager/utils/fast_notification.dart';
import 'package:liftmanager/utils/time_format.dart';
import 'package:liftmanager/utils/toast.dart';
import 'package:liftmanager/widgets/app_bar.dart';
import 'package:liftmanager/widgets/load_image.dart';

class PiaoWait extends StatefulWidget {
  // QuestionList(this.index);

  // final String index;

  bool checkAll = false;
  @override
  PiaoWaitState createState() => PiaoWaitState();
}

class PiaoWaitState extends State<PiaoWait> {
  int _page = 1;
  List<int> idList = [];
  List<int> commentListWidget = [];
  List<dynamic> listCase;
  String totalMoney = '0.00';

  bool _hasData = false;

  bool _isEdit = false;
  @override
  void initState() {
    super.initState();
    getLiftCasesListNoPage();
    print(66666);

    FastNotification.addListener("initThisPiao", (initThisStringPiao) {
      if (mounted) {
        getLiftCasesListNoPage();
      }
    });
  }

  complayTotalMoney() {
    double price = 0.0;
    listCase.forEach((subitem) {
      idList.forEach((i) {
        if (subitem.id == i) {
          price += double.parse('${subitem.payCost}');
        }
      });
    });

    setState(() {
      totalMoney = price.toStringAsFixed(2);
      widget.checkAll = (idList.length == listCase.length);
    });
  }

  Future getLiftCasesListNoPage() async {
    await NewApiService().getLiftCasesListNoPage(onSuccess: (res) {
      if (res != null) {
        _hasData = true;
        listCase = res;
        res.forEach((item) {
          // print(JsonEncoder().convert(item));
          // print(item.id);
          commentListWidget.add(item.id);
        });

        // LogUtil.d(JsonEncoder().convert(listCase));
        print(123);
        setState(() {});
      }
    }, onError: (code, msg) {
      toasts(msg);
    });
  }

  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    double width = MediaQuery.of(context).size.width;
    String checkFalse = "tab_first/check_false";
    String checkTrue = "tab_first/check_true";

    return Scaffold(
        // resizeToAvoidBottomPadding: true,
        appBar: MyAppBar(
          centerTitle: "待开发票",
          actions: <Widget>[
            !_isEdit
                ? FlatButton(
                    child: Text("开发票"),
                    textColor: Colours.text,
                    highlightColor: Colors.transparent,
                    onPressed: () {
                      setState(() {
                        _isEdit = true;
                      });

                      // NavigatorUtils.push(context, WodeRouter.piaotou);
                    },
                  )
                : Container()
          ],
        ),
        body: _hasData
            ? SafeArea(
                child: Stack(
                children: <Widget>[
                  listCase.length > 0
                      ? Container(
                          color: Color(0xffF6F6F6),
                          margin: EdgeInsets.only(bottom: _isEdit ? 60 : 0),
                          // color: Color(0xFFF1F4FC),
                          child: ListView(
                            children: <Widget>[
                              OrderListItemWidget(
                                  idList: idList,
                                  lists: listCase,
                                  isEdit: _isEdit,
                                  changeState: (id) {
                                    setState(() {
                                      print(557);
                                      if (idList.contains(id)) {
                                        idList.remove(id);
                                      } else {
                                        idList.add(id);
                                      }
                                      print(idList);
                                      print(commentListWidget);
                                      if (commentListWidget.length ==
                                          idList.length) {
                                        widget.checkAll = true;
                                        print(widget.checkAll);
                                        print(555);
                                      } else {
                                        widget.checkAll = false;
                                        print(widget.checkAll);
                                        print(556);
                                      }

                                      complayTotalMoney();
                                      print(idList);
                                      print(557);
                                    });
                                  })
                            ],
                          ),
                        )
                      : Center(child: Text("暂无数据")),
                  _isEdit
                      ? Positioned(
                          bottom: 0,
                          left: 0,
                          child: Container(
                              width: width,
                              child: Row(children: <Widget>[
                                Container(
                                    height: 60,
                                    // width: width / 2,
                                    color: Colors.white,
                                    child: GestureDetector(
                                        onTap: () {
                                          print(commentListWidget);
                                          setState(() {
                                            widget.checkAll = !widget.checkAll;
                                            if (widget.checkAll == false) {
                                              idList = [];
                                            } else {
                                              idList = [];
                                              commentListWidget.forEach((item) {
                                                idList.add(item);
                                              });
                                            }
                                          });
                                          complayTotalMoney();
                                          print(idList);
                                          print(89888);
                                          print(commentListWidget);
                                        },
                                        child: Row(
                                          mainAxisAlignment:
                                              MainAxisAlignment.center,
                                          children: <Widget>[
                                            SizedBox(width: 20),
                                            LoadAssetImage(
                                              // image: AssetImage(i['img']),
                                              widget.checkAll == true
                                                  ? checkTrue
                                                  : checkFalse,
                                              width: ScreenUtil().setWidth(20),
                                              height: ScreenUtil().setWidth(20),
                                              // alignment: Alignment.centerLeft,
                                            ),
                                            SizedBox(width: 5),
                                            Text(
                                              "已选",
                                              style: TextStyle(
                                                  fontSize:
                                                      ScreenUtil().setSp(14)),
                                            ),
                                            Text(
                                              "${idList.length}",
                                              style: TextStyle(
                                                  color: Colours.blue_app_main,
                                                  fontSize:
                                                      ScreenUtil().setSp(14)),
                                            )
                                          ],
                                        ))),
                                Container(
                                    height: 60,
                                    // width: width / 2,
                                    color: Colors.white,
                                    child: Row(
                                      mainAxisAlignment:
                                          MainAxisAlignment.center,
                                      children: <Widget>[
                                        SizedBox(
                                          width: 40,
                                        ),
                                        Text(
                                          "合计:",
                                          style: TextStyle(
                                              fontSize: ScreenUtil().setSp(14)),
                                        ),
                                        Text(
                                          " ￥$totalMoney",
                                          style: TextStyle(
                                              color: Color(0xffFF5B00),
                                              fontSize: ScreenUtil().setSp(14)),
                                        )
                                      ],
                                    )),
                                Expanded(child: Container()),
                                Container(
                                  height: 50,
                                  width: 130,
                                  margin: EdgeInsets.only(right: 10),
                                  // color: Color(0xff0388FD),
                                  decoration: new BoxDecoration(
                                    //背景
                                    color: Colours.blue_app_main,
                                    //设置四周圆角 角度
                                    borderRadius:
                                        BorderRadius.all(Radius.circular(25.0)),
                                  ),
                                  child: FlatButton(
                                    // padding: EdgeInsets.all(15.0),
                                    child: Text(
                                      "申请发票",
                                      style: TextStyle(
                                          fontSize: ScreenUtil().setSp(16)),
                                    ),
                                    textColor: Colors.white,
                                    onPressed: () {
                                      if (idList.length > 0) {
                                        String str = "";
                                        idList.forEach((item) {
                                          str += (item.toString() + ",");
                                        });
                                        print(str.substring(0, str.length));
                                        print(456);
                                        // double price = 0.0;
                                        // listCase.forEach((subitem) {
                                        //   idList.forEach((i) {
                                        //     if (subitem.id == i) {
                                        //       price += subitem.payCost;
                                        //     }
                                        //   });
                                        // });

                                        NavigatorUtils.push(context,
                                            "${WodeRouter.kaipiao}?ids=${str.substring(0, str.length)}&price=${totalMoney.toString()}");
                                        idList = [];
                                        print(idList);
                                      } else {
                                        toasts("请选择一项");
                                      }
                                    },
                                  ),
                                ),
                              ])))
                      : Container(child: null)
                ],
              ))
            : Center(
                child: Text("正在加载..."),
              ));
  }
}

class OrderListItemWidget extends StatelessWidget {
  OrderListItemWidget(
      {Key key,
      this.data,
      this.changeState,
      this.idList,
      this.lists,
      this.isEdit})
      : super(key: key);
  LiftCasesDetailModel data;
  Function changeState;
  List<int> idList;
  List<dynamic> lists;
  String checkFalse = "tab_first/check_false";
  String checkTrue = "tab_first/check_true";
  bool isEdit;

  List<Widget> getListWdiget(context) => lists.asMap().keys.map((i) {
        double width = MediaQuery.of(context).size.width;
        return Container(
          // height: 20,

          margin: EdgeInsets.fromLTRB(10, 10, 10, 0),
          padding: EdgeInsets.only(
              bottom: ScreenUtil().setWidth(15),
              top: ScreenUtil().setWidth(15)),
          decoration: new BoxDecoration(
            //背景
            color: Colors.white,
            //设置四周圆角 角度
            borderRadius: BorderRadius.all(Radius.circular(5.0)),
          ),
          child: Row(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: <Widget>[
              isEdit
                  ? GestureDetector(
                      child: Container(
                        padding: EdgeInsets.only(
                            top: ScreenUtil().setWidth(0),
                            left: ScreenUtil().setWidth(5),
                            right: ScreenUtil().setWidth(5),
                            bottom: ScreenUtil().setWidth(10)),
                        child: LoadAssetImage(
                          // image: AssetImage(i['img']),
                          idList.contains(lists[i].id) ? checkTrue : checkFalse,
                          width: ScreenUtil().setWidth(20),
                          height: ScreenUtil().setWidth(20),
                          // alignment: Alignment.centerLeft,
                        ),
                      ),
                      onTap: () {
                        changeState(lists[i].id);
                      },
                    )
                  : Container(),
              Expanded(
                child: GestureDetector(
                  onTap: () {
                    NavigatorUtils.push(
                        context, "${WodeRouter.orderDetail}?id=${lists[i].id}");
                    // NavigatorUtils.push(context,
                    //     "${BbsRouter.recommendAsk}?id=${detailObj.id}&type=3");
                  },
                  child: Row(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: <Widget>[
                      SizedBox(
                        width: 10,
                      ),
                      ClipRRect(
                        borderRadius: BorderRadius.circular(20),
                        child: LoadNetworkImage(
                          lists[i].avatarUrl,
                          width: ScreenUtil().setWidth(43),
                          height: ScreenUtil().setWidth(43),
                          // alignment: Alignment.centerLeft,
                        ),
                      ),
                      SizedBox(
                        width: 10,
                      ),
                      Expanded(
                        child: Container(
                          padding: EdgeInsets.only(right: 10),
                          child: Column(
                            children: <Widget>[
                              Container(
                                child: Row(
                                  mainAxisAlignment: MainAxisAlignment.start,
                                  children: <Widget>[
                                    Row(
                                      crossAxisAlignment:
                                          CrossAxisAlignment.center,
                                      children: <Widget>[
                                        Text(
                                          lists[i].name ?? '',
                                          style: TextStyle(
                                            fontSize: ScreenUtil().setSp(17),
                                          ),
                                          textAlign: TextAlign.start,
                                        ),
                                        Container(
                                          decoration: BoxDecoration(
                                            //背景
                                            color: lists[i].dataTable == 1
                                                ? Colours.blue_app_main
                                                : Color(0xffFDAF2C),
                                            //设置四周圆角 角度
                                            borderRadius: BorderRadius.all(
                                                Radius.circular(4.0)),
                                          ),
                                          margin: EdgeInsets.only(left: 5),
                                          padding: EdgeInsets.only(
                                              left: 5,
                                              right: 5,
                                              top: 2,
                                              bottom: 2),
                                          child: Text(
                                            lists[i].dataTable == 1
                                                ? '问诊服务'
                                                : '出诊服务',
                                            style: TextStyle(
                                              color: Colors.white,
                                              fontSize: ScreenUtil().setSp(14),
                                            ),
                                            textAlign: TextAlign.start,
                                          ),
                                        ),
                                      ],
                                    ),
                                  ],
                                ),
                              ),

                              Container(
                                child: Row(
                                  mainAxisAlignment:
                                      MainAxisAlignment.spaceBetween,
                                  children: <Widget>[
                                    Row(
                                      crossAxisAlignment:
                                          CrossAxisAlignment.center,
                                      children: <Widget>[
                                        Text(
                                          lists[i].createTime != null
                                              ? DateUtils.instance
                                                  .getFormartData(
                                                      timeSamp:
                                                          lists[i].createTime,
                                                      format: "MM月dd日")
                                              : '',
                                          style: TextStyle(
                                            color: Color(0xff999999),
                                            fontSize: ScreenUtil().setSp(13),
                                          ),
                                          textAlign: TextAlign.start,
                                        ),
                                        Container(
                                          padding: EdgeInsets.only(left: 5),
                                          child: Text(
                                            lists[i].brandName ?? '',
                                            style: TextStyle(
                                              color: Colours.blue_app_main,
                                              fontSize: ScreenUtil().setSp(13),
                                            ),
                                            textAlign: TextAlign.start,
                                          ),
                                        )
                                      ],
                                    ),
                                  ],
                                ),
                              ),
                              lists[i].dataTable != 1
                                  ? Container(
                                      child: Row(
                                        mainAxisAlignment:
                                            MainAxisAlignment.spaceBetween,
                                        children: <Widget>[
                                          Row(
                                            crossAxisAlignment:
                                                CrossAxisAlignment.start,
                                            children: <Widget>[
                                              Container(
                                                // padding: EdgeInsets.only(left: 5),
                                                child: Text(
                                                  '出诊时间：',
                                                  style: TextStyle(
                                                    color: Color(0xff999999),
                                                    fontSize:
                                                        ScreenUtil().setSp(13),
                                                  ),
                                                  textAlign: TextAlign.start,
                                                ),
                                              ),
                                              Text(
                                                lists[i].createTime != null
                                                    ? DateUtils.instance
                                                        .getFormartData(
                                                            timeSamp: lists[i]
                                                                .createTime,
                                                            format:
                                                                "MM月dd日 HH:mm")
                                                    : '',
                                                style: TextStyle(
                                                  color: Color(0xff666666),
                                                  fontSize:
                                                      ScreenUtil().setSp(13),
                                                ),
                                                textAlign: TextAlign.start,
                                              ),
                                            ],
                                          ),
                                        ],
                                      ),
                                    )
                                  : Container(),
                              lists[i].dataTable != 1
                                  ? Container(
                                      // margin: EdgeInsets.only(top: 6),
                                      child: Row(
                                        children: <Widget>[
                                          Container(
                                            // padding: EdgeInsets.only(left: 5),
                                            child: Text(
                                              '出诊地点：',
                                              style: TextStyle(
                                                color: Color(0xff999999),
                                                fontSize:
                                                    ScreenUtil().setSp(13),
                                              ),
                                              textAlign: TextAlign.start,
                                            ),
                                          ),
                                          Container(
                                            width: ScreenUtil()
                                                .setWidth(isEdit ? 190 : 220),
                                            child: Text(
                                              '${lists[i].address ?? ''}',
                                              style: TextStyle(
                                                color: Color(0xff666666),
                                                fontSize:
                                                    ScreenUtil().setSp(13),
                                                // color: Color(0xff666666),
                                                // fontSize: ScreenUtil().setSp(15),
                                              ),
                                              textAlign: TextAlign.start,
                                              maxLines: 1,
                                              overflow: TextOverflow.ellipsis,
                                            ),
                                          ),
                                        ],
                                      ),
                                    )
                                  : Container(),
                              Container(
                                // margin: EdgeInsets.only(top: 6),
                                child: Row(
                                  children: <Widget>[
                                    Container(
                                      // padding: EdgeInsets.only(left: 5),
                                      child: Text(
                                        '问题描述：',
                                        style: TextStyle(
                                          color: Color(0xff999999),
                                          fontSize: ScreenUtil().setSp(13),
                                        ),
                                        textAlign: TextAlign.start,
                                      ),
                                    ),
                                    Container(
                                      width: ScreenUtil()
                                          .setWidth(isEdit ? 190 : 220),
                                      child: Text(
                                        '${lists[i].expression ?? ''}',
                                        style: TextStyle(
                                          color: Color(0xff666666),
                                          fontSize: ScreenUtil().setSp(13),
                                          // color: Color(0xff666666),
                                          // fontSize: ScreenUtil().setSp(15),
                                        ),
                                        textAlign: TextAlign.start,
                                        maxLines: 1,
                                        overflow: TextOverflow.ellipsis,
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(top: 6),
                                child: Row(
                                  children: <Widget>[
                                    Container(
                                      padding: EdgeInsets.only(right: 5),
                                      child: Text(
                                        lists[i].payCost != null
                                            ? "￥${lists[i].payCost.toString()}"
                                            : '',
                                        style: TextStyle(
                                          color: Color(0xffFD0808),
                                          fontSize: ScreenUtil().setSp(15),
                                        ),
                                        textAlign: TextAlign.start,
                                      ),
                                    ),
                                  ],
                                ),
                              )
                              // Container(
                              //   child: Row(
                              //     mainAxisAlignment:
                              //         MainAxisAlignment.start,
                              //     children: <Widget>[
                              //       Row(
                              //         crossAxisAlignment:
                              //             CrossAxisAlignment
                              //                 .center,
                              //         children: <Widget>[
                              //           Text(
                              //             detailObj.createTime !=
                              //                     null
                              //                 ? DateUtils
                              //                     .instance
                              //                     .getFormartData(
                              //                     timeSamp:
                              //                         detailObj
                              //                             .createTime,
                              //                     format:
                              //                         "MM月dd日",
                              //                   )
                              //                 : '',
                              //             style: TextStyle(
                              //               color: Color(
                              //                   0xff999999),
                              //               fontSize:
                              //                   ScreenUtil()
                              //                       .setSp(
                              //                           13),
                              //             ),
                              //             textAlign:
                              //                 TextAlign.left,
                              //           ),
                              //           Container(
                              //             padding:
                              //                 EdgeInsets.only(
                              //                     left: 5),
                              //             child: Text(
                              //               detailObj
                              //                       .brandName ??
                              //                   '',
                              //               style: TextStyle(
                              //                 color: Color(
                              //                     0xff999999),
                              //                 fontSize:
                              //                     ScreenUtil()
                              //                         .setSp(
                              //                             13),
                              //               ),
                              //               textAlign:
                              //                   TextAlign
                              //                       .left,
                              //             ),
                              //           )
                              //         ],
                              //       ),
                              //     ],
                              //   ),
                              // ),
                              // Row(
                              //   mainAxisAlignment:
                              //       MainAxisAlignment.start,
                              //   children: <Widget>[
                              //     Container(
                              //       width: 260,
                              //       child: Text(
                              //         detailObj.expression ??
                              //             '',
                              //         style: TextStyle(
                              //           color:
                              //               Color(0xff0288FF),
                              //           fontSize: ScreenUtil()
                              //               .setSp(15),
                              //         ),
                              //         textAlign:
                              //             TextAlign.left,
                              //         maxLines: 1,
                              //         overflow: TextOverflow
                              //             .ellipsis,
                              //       ),
                              //     ),
                              //   ],
                              // ),
                            ],
                          ),
                        ),
                      )
                    ],
                  ),
                ),
              ),
            ],
          ),
        );

        // Container(
        //   padding: EdgeInsets.all(ScreenUtil().setWidth(10)),
        //   width: width,
        //   decoration: BoxDecoration(
        //     border: Border(
        //       bottom: BorderSide(width: 0.5, color: Colours.line),
        //     ),
        //   ),
        //   // height: 100,
        //   child: Row(
        //     children: <Widget>[
        //       GestureDetector(
        //         child: Container(
        //           padding: EdgeInsets.only(
        //               top: ScreenUtil().setWidth(10),
        //               left: ScreenUtil().setWidth(5),
        //               right: ScreenUtil().setWidth(5),
        //               bottom: ScreenUtil().setWidth(10)),
        //           child: LoadAssetImage(
        //             // image: AssetImage(i['img']),
        //             idList.contains(lists[i].id) ? checkTrue : checkFalse,
        //             width: ScreenUtil().setWidth(20),
        //             height: ScreenUtil().setWidth(20),
        //             // alignment: Alignment.centerLeft,
        //           ),
        //         ),
        //         onTap: () {
        //           changeState(lists[i].id);
        //         },
        //       ),
        //       Expanded(
        //         child: GestureDetector(
        //           behavior: HitTestBehavior.opaque,
        //           onTap: () {
        //             NavigatorUtils.push(
        //                 context, "${WodeRouter.orderDetail}?id=${lists[i].id}");
        //           },
        //           child: Row(
        //             crossAxisAlignment: CrossAxisAlignment.start,
        //             // mainAxisSize: MainAxisSize.min,
        //             children: <Widget>[
        //               Container(
        //                 margin: EdgeInsets.only(
        //                     left: ScreenUtil().setWidth(10),
        //                     right: ScreenUtil().setWidth(10),
        //                     top: ScreenUtil().setWidth(5)),
        //                 decoration: BoxDecoration(
        //                   borderRadius:
        //                       BorderRadius.circular(ScreenUtil().setWidth(22)),
        //                 ),
        //                 child: ClipRRect(
        //                   borderRadius:
        //                       BorderRadius.circular(ScreenUtil().setWidth(22)),
        //                   child: LoadNetworkImage(
        //                     lists[i].avatarUrl,
        //                     width: ScreenUtil().setWidth(43),
        //                     height: ScreenUtil().setWidth(43),
        //                     // alignment: Alignment.centerLeft,
        //                   ),
        //                 ),
        //               ),
        //               Expanded(
        //                 // flex: 1,
        //                 // fit: FlexFit.loose,
        //                 child: Container(
        //                   padding:
        //                       EdgeInsets.only(right: ScreenUtil().setWidth(15)),
        //                   child: Column(
        //                     children: <Widget>[
        //                       Container(
        //                         child: Row(
        //                           mainAxisAlignment:
        //                               MainAxisAlignment.spaceBetween,
        //                           children: <Widget>[
        //                             Row(
        //                               crossAxisAlignment:
        //                                   CrossAxisAlignment.center,
        //                               children: <Widget>[
        //                                 Text(
        //                                   lists[i].name,
        //                                   style: TextStyle(
        //                                       color: Color(0xff333333),
        //                                       fontSize: ScreenUtil().setSp(17)),
        //                                   textAlign: TextAlign.start,
        //                                 ),
        //                                 Container(
        //                                   padding: EdgeInsets.only(left: 5),
        //                                   child: Text(
        //                                     lists[i].dataTable == 1
        //                                         ? '问诊服务'
        //                                         : '出诊服务',
        //                                     style: TextStyle(
        //                                       color: Color(0xff0288FF),
        //                                       fontSize: ScreenUtil().setSp(14),
        //                                     ),
        //                                     textAlign: TextAlign.start,
        //                                   ),
        //                                 )
        //                               ],
        //                             ),
        //                             // Container(
        //                             //   child: Text(
        //                             //     OrderConstant.getStatusName(data.statuz, data.dataTable, arrivedFlag: data.arrivedFlag, userType: 'USER'),
        //                             //     style: TextStyle(
        //                             //       color: [].indexOf(data.statuz) == -1
        //                             //           ? Color(0xff0288FF)
        //                             //           : Color(0xffF84203),
        //                             //       fontSize: ScreenUtil().setSp(14),
        //                             //     ),
        //                             //     textAlign: TextAlign.end,
        //                             //   ),
        //                             // )
        //                           ],
        //                         ),
        //                       ),
        //                       Container(
        //                         child: Row(
        //                           mainAxisAlignment:
        //                               MainAxisAlignment.spaceBetween,
        //                           children: <Widget>[
        //                             Row(
        //                               crossAxisAlignment:
        //                                   CrossAxisAlignment.center,
        //                               children: <Widget>[
        //                                 Text(
        //                                   lists[i].createTime != null
        //                                       ? DateUtils.instance
        //                                           .getFormartData(
        //                                               timeSamp:
        //                                                   lists[i].createTime,
        //                                               format: "yyyy-MM-dd")
        //                                       : '',
        //                                   style: TextStyle(
        //                                     color: Color(0xff999999),
        //                                     fontSize: ScreenUtil().setSp(13),
        //                                   ),
        //                                   textAlign: TextAlign.start,
        //                                 ),
        //                                 Container(
        //                                   padding: EdgeInsets.only(left: 5),
        //                                   child: Text(
        //                                     lists[i].brandName ?? '',
        //                                     style: TextStyle(
        //                                       color: Color(0xff999999),
        //                                       fontSize: ScreenUtil().setSp(13),
        //                                     ),
        //                                     textAlign: TextAlign.start,
        //                                   ),
        //                                 )
        //                               ],
        //                             ),
        //                           ],
        //                         ),
        //                       ),
        //                       Container(
        //                         // margin: EdgeInsets.only(top: 6),
        //                         child: Row(
        //                           children: <Widget>[
        //                             Container(
        //                               width: width * 0.6,
        //                               padding: EdgeInsets.only(right: 5),
        //                               child: Text(
        //                                 lists[i].expression ?? '',
        //                                 style: TextStyle(
        //                                   color: Color(0xff666666),
        //                                   fontSize: ScreenUtil().setSp(15),
        //                                 ),
        //                                 textAlign: TextAlign.start,
        //                                 maxLines: 1,
        //                                 overflow: TextOverflow.ellipsis,
        //                               ),
        //                             ),
        //                           ],
        //                         ),
        //                       ),
        //                       Container(
        //                         margin: EdgeInsets.only(top: 6),
        //                         child: Row(
        //                           children: <Widget>[
        //                             Container(
        //                               padding: EdgeInsets.only(right: 5),
        //                               child: Text(
        //                                 lists[i].payCost != null
        //                                     ? "￥${lists[i].payCost.toString()}"
        //                                     : '',
        //                                 style: TextStyle(
        //                                   color: Color(0xffFD0808),
        //                                   fontSize: ScreenUtil().setSp(15),
        //                                 ),
        //                                 textAlign: TextAlign.start,
        //                               ),
        //                             ),
        //                           ],
        //                         ),
        //                       )
        //                     ],
        //                   ),
        //                 ),
        //               )
        //             ],
        //           ),
        //         ),
        //       )
        //     ],
        //   ),
        // );
      }).toList();

  @override
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: getListWdiget(context),
      ),
    );
  }
}
