import 'package:zhiying_base_widget/pages/team_page/model/team_style_model.dart';
import 'package:meta/meta.dart';

@immutable
class TeamDetailsStyleModel {
  String app_bar_bg_color;
  String app_bar_bg_img;
  String app_bar_name;
  String app_bar_name_color;
  String bg_color;
  List<TeamDetailsStyleModelDashbord> dashbord;
  List<TeamDetailsStyleModelDashbordItem> dashbord_items;
  String dashbord_line_color;
  String name_color;
  String name_selected_color;
  TeamDetailsStyleModelHeaderReferrer header_referrer;
  TeamViewItemStyle self_info;

  TeamDetailsStyleModel({
    this.app_bar_bg_color,
    this.app_bar_bg_img,
    this.app_bar_name,
    this.app_bar_name_color,
    this.bg_color,
    this.dashbord,
    this.dashbord_items,
    this.dashbord_line_color,
    this.header_referrer,
    this.self_info,
    this.name_color,
    this.name_selected_color,
  });

  factory TeamDetailsStyleModel.fromJson(Map<String, dynamic> json) {
    return TeamDetailsStyleModel(
      name_color: json['name_color'],
      name_selected_color: json['name_selected_color'],
      app_bar_bg_color: json['app_bar_bg_color'],
      app_bar_bg_img: json['app_bar_bg_img'],
      app_bar_name: json['app_bar_name'],
      app_bar_name_color: json['app_bar_name_color'],
      bg_color: json['bg_color'],
      dashbord: json['dashbord'] != null ? (json['dashbord'] as List).map((i) => TeamDetailsStyleModelDashbord.fromJson(i)).toList() : null,
      dashbord_items: json['dashbord_items'] != null ? (json['dashbord_items'] as List).map((i) => TeamDetailsStyleModelDashbordItem.fromJson(i)).toList() : null,
      dashbord_line_color: json['dashbord_line_color'],
      header_referrer: json['header_referrer'] != null ? TeamDetailsStyleModelHeaderReferrer.fromJson(json['header_referrer']) : null,
      self_info: json['self_info'] != null ? TeamViewItemStyle.fromJson(json['self_info']) : null,
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['app_bar_bg_color'] = this.app_bar_bg_color;
    data['app_bar_bg_img'] = this.app_bar_bg_img;
    data['app_bar_name'] = this.app_bar_name;
    data['app_bar_name_color'] = this.app_bar_name_color;
    data['bg_color'] = this.bg_color;
    data['dashbord_line_color'] = this.dashbord_line_color;
    data['name_selected_color'] = this.name_selected_color;
    data['name_color'] = name_color;
    if (this.dashbord != null) {
      data['dashbord'] = this.dashbord.map((v) => v.toJson()).toList();
    }
    if (this.dashbord_items != null) {
      data['dashbord_items'] = this.dashbord_items.map((v) => v.toJson()).toList();
    }
    if (this.header_referrer != null) {
      data['header_referrer'] = this.header_referrer.toJson();
    }
    if (this.self_info != null) {
      data['self_info'] = this.self_info.toJson();
    }
    return data;
  }
}

class TeamDetailsStyleModelDashbordItem {
  String bg_color;
  String text_color;
  String text_icon;
  List<String> texts;
  String title;
  String title_bg_img;
  String title_color;
  String value_color;

  TeamDetailsStyleModelDashbordItem({this.bg_color, this.text_color, this.text_icon, this.texts, this.title, this.title_bg_img, this.title_color, this.value_color});

  factory TeamDetailsStyleModelDashbordItem.fromJson(Map<String, dynamic> json) {
    return TeamDetailsStyleModelDashbordItem(
      bg_color: json['bg_color'],
      text_color: json['text_color'],
      text_icon: json['text_icon'],
      texts: json['texts'] != null ? new List<String>.from(json['texts']) : null,
      title: json['title'],
      title_bg_img: json['title_bg_img'],
      title_color: json['title_color'],
      value_color: json['value_color'],
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['bg_color'] = this.bg_color;
    data['text_color'] = this.text_color;
    data['text_icon'] = this.text_icon;
    data['title'] = this.title;
    data['title_bg_img'] = this.title_bg_img;
    data['title_color'] = this.title_color;
    data['value_color'] = this.value_color;
    if (this.texts != null) {
      data['texts'] = this.texts;
    }
    return data;
  }
}

class TeamDetailsStyleModelHeaderReferrer {
  String bar_color;
  String copy_btn_bg_color;
  String copy_btn_icon;
  String copy_btn_text;
  String copy_btn_text_color;
  String last_login_text;
  String last_login_text_color;
  String last_login_value_color;
  String phone_color;
  String phone_text;
  String title;
  String title_bg_color;
  String title_bg_color_t;
  String title_color;
  String username_color;
  String wx_color;
  String wx_text;
  String wx_value_color;
  String lv_text_color;

  TeamDetailsStyleModelHeaderReferrer({
    this.bar_color,
    this.copy_btn_bg_color,
    this.copy_btn_icon,
    this.copy_btn_text,
    this.copy_btn_text_color,
    this.last_login_text,
    this.last_login_text_color,
    this.last_login_value_color,
    this.phone_color,
    this.phone_text,
    this.title,
    this.title_bg_color,
    this.title_bg_color_t,
    this.title_color,
    this.username_color,
    this.wx_color,
    this.wx_text,
    this.wx_value_color,
    this.lv_text_color,
  });

  factory TeamDetailsStyleModelHeaderReferrer.fromJson(Map<String, dynamic> json) {
    return TeamDetailsStyleModelHeaderReferrer(
        bar_color: json['bar_color'],
        copy_btn_bg_color: json['copy_btn_bg_color'],
        copy_btn_icon: json['copy_btn_icon'],
        copy_btn_text: json['copy_btn_text'],
        copy_btn_text_color: json['copy_btn_text_color'],
        last_login_text: json['last_login_text'],
        last_login_text_color: json['last_login_text_color'],
        last_login_value_color: json['last_login_value_color'],
        phone_color: json['phone_color'],
        phone_text: json['phone_text'],
        title: json['title'],
        title_bg_color: json['title_bg_color'],
        title_bg_color_t: json['title_bg_color_t'],
        title_color: json['title_color'],
        username_color: json['username_color'],
        wx_color: json['wx_color'],
        wx_text: json['wx_text'],
        wx_value_color: json['wx_value_color'],
        lv_text_color: json['lv_text_color'],
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['bar_color'] = this.bar_color;
    data['copy_btn_bg_color'] = this.copy_btn_bg_color;
    data['copy_btn_icon'] = this.copy_btn_icon;
    data['copy_btn_text'] = this.copy_btn_text;
    data['copy_btn_text_color'] = this.copy_btn_text_color;
    data['last_login_text'] = this.last_login_text;
    data['last_login_text_color'] = this.last_login_text_color;
    data['last_login_value_color'] = this.last_login_value_color;
    data['phone_color'] = this.phone_color;
    data['phone_text'] = this.phone_text;
    data['title'] = this.title;
    data['title_bg_color'] = this.title_bg_color;
    data['title_bg_color_t'] = this.title_bg_color_t;
    data['title_color'] = this.title_color;
    data['username_color'] = this.username_color;
    data['wx_color'] = this.wx_color;
    data['wx_text'] = this.wx_text;
    data['wx_value_color'] = this.wx_value_color;
    data['lv_text_color'] = this.lv_text_color;
    return data;
  }
}

class TeamDetailsStyleModelDashbord {
  String name;

  TeamDetailsStyleModelDashbord({this.name});

  factory TeamDetailsStyleModelDashbord.fromJson(Map<String, dynamic> json) {
    return TeamDetailsStyleModelDashbord(
      name: json['name'],
    );
  }

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