class WalletDetailModel {
  List<Providers> providers;
  List<DateList> dateList;
  ProviderDashbord providerDashbord;

  WalletDetailModel({this.providers, this.dateList, this.providerDashbord});

  WalletDetailModel.fromJson(Map<String, dynamic> json) {
    if (json['providers'] != null) {
      providers = new List<Providers>();
      json['providers'].forEach((v) {
        providers.add(new Providers.fromJson(v));
      });
    }
    if (json['date_list'] != null) {
      dateList = new List<DateList>();
      json['date_list'].forEach((v) {
        dateList.add(new DateList.fromJson(v));
      });
    }
    providerDashbord = json['provider_dashbord'] != null
        ? new ProviderDashbord.fromJson(json['provider_dashbord'])
        : null;
  }

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

class Providers {
  String type;
  String name;
  String unselectColor;
  String selectColor;
  String lineColor;

  Providers(
      {this.type,
        this.name,
        this.unselectColor,
        this.selectColor,
        this.lineColor});

  Providers.fromJson(Map<String, dynamic> json) {
    type = json['type'];
    name = json['name'];
    unselectColor = json['unselect_color'];
    selectColor = json['select_color'];
    lineColor = json['line_color'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['type'] = this.type;
    data['name'] = this.name;
    data['unselect_color'] = this.unselectColor;
    data['select_color'] = this.selectColor;
    data['line_color'] = this.lineColor;
    return data;
  }
}

class DateList {
  String isDefault;
  String text;
  String type;
  String textSelectColor;
  String textUnselectColor;
  String btnImg;
  String btnNoColorImg;
  String btnColorImg;

  DateList(
      {this.isDefault,
        this.text,
        this.type,
        this.textSelectColor,
        this.textUnselectColor,
        this.btnImg,
        this.btnNoColorImg,
        this.btnColorImg});

  DateList.fromJson(Map<String, dynamic> json) {
    isDefault = json['is_default'];
    text = json['text'];
    type = json['type'];
    textSelectColor = json['text_select_color'];
    textUnselectColor = json['text_unselect_color'];
    btnImg = json['btn_img'];
    btnNoColorImg = json['btn_no_color_img'];
    btnColorImg = json['btn_color_img'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['is_default'] = this.isDefault;
    data['text'] = this.text;
    data['type'] = this.type;
    data['text_select_color'] = this.textSelectColor;
    data['text_unselect_color'] = this.textUnselectColor;
    data['btn_img'] = this.btnImg;
    data['btn_no_color_img'] = this.btnNoColorImg;
    data['btn_color_img'] = this.btnColorImg;
    return data;
  }
}

class ProviderDashbord {
  Finish finish;
  SelfBuy selfBuy;
  SelfBuy directPromote;
  SelfBuy indirectPromote;

  ProviderDashbord(
      {this.finish, this.selfBuy, this.directPromote, this.indirectPromote});

  ProviderDashbord.fromJson(Map<String, dynamic> json) {
    finish =
    json['finish'] != null ? new Finish.fromJson(json['finish']) : null;
    selfBuy = json['self_buy'] != null
        ? new SelfBuy.fromJson(json['self_buy'])
        : null;
    directPromote = json['direct_promote'] != null
        ? new SelfBuy.fromJson(json['direct_promote'])
        : null;
    indirectPromote = json['indirect_promote'] != null
        ? new SelfBuy.fromJson(json['indirect_promote'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.finish != null) {
      data['finish'] = this.finish.toJson();
    }
    if (this.selfBuy != null) {
      data['self_buy'] = this.selfBuy.toJson();
    }
    if (this.directPromote != null) {
      data['direct_promote'] = this.directPromote.toJson();
    }
    if (this.indirectPromote != null) {
      data['indirect_promote'] = this.indirectPromote.toJson();
    }
    return data;
  }
}

class Finish {
  String isShow;
  String text;
  String textColor;
  String valueColor;
  String vauleKey;
  String bgImg;
  String tipIcon;
  String tipText;

  Finish(
      {this.isShow,
        this.text,
        this.textColor,
        this.valueColor,
        this.vauleKey,
        this.bgImg,
        this.tipIcon,
        this.tipText});

  Finish.fromJson(Map<String, dynamic> json) {
    isShow = json['is_show'];
    text = json['text'];
    textColor = json['text_color'];
    valueColor = json['value_color'];
    vauleKey = json['vaule_key'];
    bgImg = json['bg_img'];
    tipIcon = json['tip_icon'];
    tipText = json['tip_text'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['is_show'] = this.isShow;
    data['text'] = this.text;
    data['text_color'] = this.textColor;
    data['value_color'] = this.valueColor;
    data['vaule_key'] = this.vauleKey;
    data['bg_img'] = this.bgImg;
    data['tip_icon'] = this.tipIcon;
    data['tip_text'] = this.tipText;
    return data;
  }
}

class SelfBuy {
  String isShow;
  String title;
  String titleColor;
  List<ItemList> itemList;

  SelfBuy({this.isShow, this.title, this.titleColor, this.itemList});

  SelfBuy.fromJson(Map<String, dynamic> json) {
    isShow = json['is_show'];
    title = json['title'];
    titleColor = json['title_color'];
    if (json['list'] != null) {
      itemList = new List<ItemList>();
      json['list'].forEach((v) {
        itemList.add(new ItemList.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['is_show'] = this.isShow;
    data['title'] = this.title;
    data['title_color'] = this.titleColor;
    if (this.itemList != null) {
      data['list'] = this.itemList.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class ItemList {
  String bgImg;
  String text;
  String textColor;
  String vauleKey;
  String valueColor;
  String tipIcon;
  String tipText;

  ItemList(
      {this.bgImg,
        this.text,
        this.textColor,
        this.vauleKey,
        this.valueColor,
        this.tipIcon,
        this.tipText});

  ItemList.fromJson(Map<String, dynamic> json) {
    bgImg = json['bg_img'];
    text = json['text'];
    textColor = json['text_color'];
    vauleKey = json['vaule_key'];
    valueColor = json['value_color'];
    tipIcon = json['tip_icon'];
    tipText = json['tip_text'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['bg_img'] = this.bgImg;
    data['text'] = this.text;
    data['text_color'] = this.textColor;
    data['vaule_key'] = this.vauleKey;
    data['value_color'] = this.valueColor;
    data['tip_icon'] = this.tipIcon;
    data['tip_text'] = this.tipText;
    return data;
  }
}
