class GoodsDetailsTagModel {
  String name;
  String desc;
  String moduleType;
  String moduleKey;
  String isTopMargin;
  String isLeftRightMargin;
  String isShow;
  String topMargin;
  String leftRightMargin;
  String topLeftRadius;
  String topRightRadius;
  String bottomLeftRadius;
  String bottomRightRadius;
  String bgColor;
  List<TagList> tagList;
  List<String> sourceList;

  // data
  String commissionText;
  String couponText;
  String providerName;
  String title;

  GoodsDetailsTagModel({
    this.name,
    this.desc,
    this.moduleType,
    this.moduleKey,
    this.isTopMargin,
    this.isLeftRightMargin,
    this.isShow,
    this.topMargin,
    this.leftRightMargin,
    this.topLeftRadius,
    this.topRightRadius,
    this.bottomLeftRadius,
    this.bottomRightRadius,
    this.bgColor,
    this.tagList,
    this.sourceList,

    this.commissionText,
    this.couponText,
    this.providerName,
    this.title,
  });

  GoodsDetailsTagModel.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    desc = json['desc'];
    moduleType = json['module_type'];
    moduleKey = json['module_key'];
    isTopMargin = json['is_top_margin'];
    isLeftRightMargin = json['is_left_right_margin'];
    isShow = json['is_show'];
    topMargin = json['top_margin'];
    leftRightMargin = json['left_right_margin'];
    topLeftRadius = json['top_left_radius'];
    topRightRadius = json['top_right_radius'];
    bottomLeftRadius = json['bottom_left_radius'];
    bottomRightRadius = json['bottom_right_radius'];
    bgColor = json['bg_color'];
    if (json['tag_list'] != null) {
      tagList = new List<TagList>();
      json['tag_list'].forEach((v) {
        tagList.add(new TagList.fromJson(v));
      });
    }
    sourceList = json['source_list'].cast<String>();

    commissionText = json['commission_text'];
    couponText = json['coupon_text'];
    providerName = json['provider_name'];
    title = json['title'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    data['desc'] = this.desc;
    data['module_type'] = this.moduleType;
    data['module_key'] = this.moduleKey;
    data['is_top_margin'] = this.isTopMargin;
    data['is_left_right_margin'] = this.isLeftRightMargin;
    data['is_show'] = this.isShow;
    data['top_margin'] = this.topMargin;
    data['left_right_margin'] = this.leftRightMargin;
    data['top_left_radius'] = this.topLeftRadius;
    data['top_right_radius'] = this.topRightRadius;
    data['bottom_left_radius'] = this.bottomLeftRadius;
    data['bottom_right_radius'] = this.bottomRightRadius;
    data['bg_color'] = this.bgColor;
    if (this.tagList != null) {
      data['tag_list'] = this.tagList.map((v) => v.toJson()).toList();
    }
    data['source_list'] = this.sourceList;

    data['commission_text'] = this.commissionText;
    data['coupon_text'] = this.couponText;
    data['provider_name'] = this.providerName;
    data['title'] = this.title;

    return data;
  }
}

class TagList {
  String name;
  String textColor;
  String bgColor;

  TagList({this.name, this.textColor, this.bgColor});

  TagList.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    textColor = json['text_color'];
    bgColor = json['bg_color'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    data['text_color'] = this.textColor;
    data['bg_color'] = this.bgColor;
    return data;
  }
}
