sai_you_yun_change_model.dart 2.04 KB
class SaiYouYunChangeModel {
  int ret;
  List<SaiYouYunChangeSunModel> data;
  String msg;

  SaiYouYunChangeModel({this.ret, this.data, this.msg});

  SaiYouYunChangeModel.fromJson(Map<String, dynamic> json) {
    ret = json['ret'];
    if (json['data'] != null) {
      data = new List<SaiYouYunChangeSunModel>();
      json['data'].forEach((v) {
        data.add(new SaiYouYunChangeSunModel.fromJson(v));
      });
    }
    msg = json['msg'];
  }

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

class SaiYouYunChangeSunModel {
  String temp;
  Content content;
  bool select = false;

  SaiYouYunChangeSunModel({this.temp, this.content});

  SaiYouYunChangeSunModel.fromJson(Map<String, dynamic> json) {
    temp = json['temp'];
    content =
        json['content'] != null ? new Content.fromJson(json['content']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['temp'] = this.temp;
    if (this.content != null) {
      data['content'] = this.content.toJson();
    }
    return data;
  }
}

class Content {
  String id;
  String templateCode;
  String templateParam;
  String templateDemo;
  String type;

  Content(
      {this.id,
      this.templateCode,
      this.templateParam,
      this.templateDemo,
      this.type});

  Content.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    templateCode = json['template_code'];
    templateParam = json['template_param'];
    templateDemo = json['template_demo'];
    type = json['type'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['template_code'] = this.templateCode;
    data['template_param'] = this.templateParam;
    data['template_demo'] = this.templateDemo;
    data['type'] = this.type;
    return data;
  }
}