

class QuestionListModel{
  // String brand;
  // String title;
  // String icon;
  // String name;
  // String time;
  // String desc;
  // List<dynamic> imgList;
  // String nums;
  // VoidCallback onPressed;

  

  // QuestionList({
  //   this.brand,
  //   this.title,
  //   this.icon,
  //   this.name,
  //   this.time,
  //   this.desc,
  //   this.imgList,
  //   this.nums,
  //   this.onPressed,
  // });

  // static  List<QuestionList> questions =[
  //   new QuestionList(
  //     brand:"三菱",
  //     title:"电梯常见故障有哪些?",
  //     icon:"temporary/tou1",
  //     name:"小小维修工",
  //     time:"2020-02-20",
  //     desc:"1.闭合底层钥匙开关,基站不能开门 可能原因: 1.控制回路保险丝熔断 2.钥匙开关按点接触不良或破坏 3.底...",
  //     imgList:null,
  //     nums:"100"
  //   ),
  //   new QuestionList(
  //     brand:"奥的斯",
  //     title:"电梯不能正常开门是什么原因?",
  //     icon:"temporary/tou2",
  //     name:"小阿哥",
  //     time:"2020-02-20",
  //     desc:"1.闭合底层钥匙开关,基站不能开门 可能原因: 1.控制回路保险丝熔断 2.钥匙开关按点接触不良或破坏 3.底...",
  //     imgList:['temporary/wen1','temporary/wen2','temporary/wen3'],
  //     nums:"101"
  //   ),
    
  // ];
  List<QuestionListItem> data;
  QuestionListModel(this.data);
  factory QuestionListModel.fromJson(List json){
    return QuestionListModel(
      json.map((i)=>QuestionListItem.fromJson((i))).toList()
    );
  }
  // List<QuestionListItem> data;
  // int errorCode;
  // String errorMsg;

  // QuestionListModel({this.data, this.errorCode, this.errorMsg});

  // QuestionListModel.fromJson(Map<String, dynamic> json) {
    
  //     data = new List<QuestionListItem>();
  //     json['questionListItem'].forEach((v) {
  //       data.add(new QuestionListItem.fromJson(v));
  //     });
    
  // }

  // Map<String, dynamic> toJson() {
  //   final Map<String, dynamic> data = new Map<String, dynamic>();
  //   if (this.data != null) {
  //     data['questionListItem'] = this.data.map((v) => v.toJson()).toList();
  //   }
  //   return data;
  // }
}

class QuestionListItem{
  String brand;
  String title;
  String icon;
  String name;
  String time;
  String desc;
  List<dynamic> imgList;
  String nums;

  QuestionListItem({
    this.brand,
    this.title,
    this.icon,
    this.name,
    this.time,
    this.desc,
    this.imgList,
    this.nums,
  });

  // QuestionListItem.fromJson(Map<String,dynamic> json){
  //   QuestionListItem(
  //     brand:json["brand"],
  //     title:json["title"],
  //     icon:json["icon"],
  //     name:json["name"],
  //     time:json["time"],
  //     desc:json["desc"],
  //     imgList:json["imgList"],
  //     nums:json["nums"],
  //   );
  // }

  factory QuestionListItem.fromJson(dynamic json){
    return QuestionListItem(
      brand:json["brand"],
      title:json["title"],
      icon:json["icon"],
      name:json["name"],
      time:json["time"],
      desc:json["desc"],
      imgList:json["imgList"],
      nums:json["nums"],
    );
  }

  // Map<String,dynamic> toJson(){
  //   final Map<String,dynamic> questionListItem = new Map<String,dynamic>();
    
  //     questionListItem["brand"] = this.brand;
  //     questionListItem["title"] = this.title;
  //     questionListItem["icon"] = this.icon;
  //     questionListItem["name"] = name;
  //     questionListItem["time"] = time;
  //     questionListItem["desc"] = desc;
  //     questionListItem["imgList"] = imgList;
  //     questionListItem["nums"] = nums;
    
  // }
}