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 text;
  String textSelectColor;
  String textUnselectColor;
  String btnImg;

  DateList(
      {this.text, this.textSelectColor, this.textUnselectColor, this.btnImg});

  DateList.fromJson(Map<String, dynamic> json) {
    text = json['text'];
    textSelectColor = json['text_select_color'];
    textUnselectColor = json['text_unselect_color'];
    btnImg = json['btn_img'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['text'] = this.text;
    data['text_select_color'] = this.textSelectColor;
    data['text_unselect_color'] = this.textUnselectColor;
    data['btn_img'] = this.btnImg;
    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 text;
  String textColor;
  String valueColor;
  String bgImg;

  Finish({this.text, this.textColor, this.valueColor, this.bgImg});

  Finish.fromJson(Map<String, dynamic> json) {
    text = json['text'];
    textColor = json['text_color'];
    valueColor = json['value_color'];
    bgImg = json['bg_img'];
  }

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

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

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

  SelfBuy.fromJson(Map<String, dynamic> json) {
    title = json['title'];
    titleColor = json['title_color'];
    leftBgImg = json['left_bg_img'];
    rightBgImg = json['right_bg_img'];
    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['title'] = this.title;
    data['title_color'] = this.titleColor;
    data['left_bg_img'] = this.leftBgImg;
    data['right_bg_img'] = this.rightBgImg;
    if (this.itemList != null) {
      data['list'] = this.itemList.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class ItemList {
  String text;
  String textColor;
  String valueColor;

  ItemList({this.text, this.textColor, this.valueColor});

  ItemList.fromJson(Map<String, dynamic> json) {
    text = json['text'];
    textColor = json['text_color'];
    valueColor = json['value_color'];
  }

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