import 'package:zhiying_base_widget/widgets/home/home_goods/models/home_goods_list_style_model.dart';

class FavoritesStyleModel {
  String appBarName;
  String appBarNameColor;
  String appBarBgImg;
  String appBarBgColor;
  String appBarRightText;
  String appBarRightTextColor;
  String appBarRightEditingText;
  String appBarRightEditingColor;
  String searchBarIcon;
  String searchBarText;
  String searchBarTextColor;
  String searchBarBgColor;
  String tabLineColor;
  String tabItemNotFoundImg;
  List<TabList> tabList;
  HomeGoodsListStyleModel listStyle;
  String editLeftConfirmColor;
  String editLeftNoConfirmColor;
  Bottom bottom;
  ConfirmDialog confirmDialog;

  String tabNameColor;
  String tabNameSelectedColor;
  String editLeftConfirmIcon;
  String editLeftNoConfirmIcon;

  FavoritesStyleModel({
    this.appBarName,
    this.appBarNameColor,
    this.appBarBgImg,
    this.appBarBgColor,
    this.appBarRightText,
    this.appBarRightTextColor,
    this.appBarRightEditingText,
    this.appBarRightEditingColor,
    this.searchBarIcon,
    this.searchBarText,
    this.searchBarTextColor,
    this.searchBarBgColor,
    this.tabLineColor,
    this.tabItemNotFoundImg,
    this.tabList,
    this.listStyle,
    this.editLeftConfirmColor,
    this.editLeftNoConfirmColor,
    this.bottom,
    this.confirmDialog,
    this.tabNameColor,
    this.tabNameSelectedColor,
    this.editLeftConfirmIcon,
    this.editLeftNoConfirmIcon,
  });

  FavoritesStyleModel.fromJson(Map<String, dynamic> json) {
    appBarName = json['app_bar_name'];
    appBarNameColor = json['app_bar_name_color'];
    appBarBgImg = json['app_bar_bg_img'];
    appBarBgColor = json['app_bar_bg_color'];
    appBarRightText = json['app_bar_right_text'];
    appBarRightTextColor = json['app_bar_right_text_color'];
    appBarRightEditingText = json['app_bar_right_editing_text'];
    appBarRightEditingColor = json['app_bar_right_editing_color'];
    searchBarIcon = json['search_bar_icon'];
    searchBarText = json['search_bar_text'];
    searchBarTextColor = json['search_bar_text_color'];
    searchBarBgColor = json['search_bar_bg_color'];
    tabLineColor = json['tab_line_color'];
    tabItemNotFoundImg = json['tab_item_not_found_img'];
    if (json['tab_list'] != null) {
      tabList = new List<TabList>();
      json['tab_list'].forEach((v) {
        tabList.add(new TabList.fromJson(v));
      });
    }
    listStyle = json['list_style'] != null ? new HomeGoodsListStyleModel.fromJson(json['list_style']) : null;
    editLeftConfirmColor = json['edit_left_confirm_color'];
    editLeftNoConfirmColor = json['edit_left_no_confirm_color'];
    bottom = json['bottom'] != null ? new Bottom.fromJson(json['bottom']) : null;
    confirmDialog = json['confirm_dialog'] != null ? new ConfirmDialog.fromJson(json['confirm_dialog']) : null;

    tabNameColor = json['tab_name_color'];
    tabNameSelectedColor = json['tab_name_selected_color'];
    editLeftConfirmIcon = json['edit_left_confirm_icon'];
    editLeftNoConfirmIcon = json['edit_left_no_confirm_icon'];

  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['app_bar_name'] = this.appBarName;
    data['app_bar_name_color'] = this.appBarNameColor;
    data['app_bar_bg_img'] = this.appBarBgImg;
    data['app_bar_bg_color'] = this.appBarBgColor;
    data['app_bar_right_text'] = this.appBarRightText;
    data['app_bar_right_text_color'] = this.appBarRightTextColor;
    data['app_bar_right_editing_text'] = this.appBarRightEditingText;
    data['app_bar_right_editing_color'] = this.appBarRightEditingColor;
    data['search_bar_icon'] = this.searchBarIcon;
    data['search_bar_text'] = this.searchBarText;
    data['search_bar_text_color'] = this.searchBarTextColor;
    data['search_bar_bg_color'] = this.searchBarBgColor;
    data['tab_line_color'] = this.tabLineColor;
    data['tab_item_not_found_img'] = this.tabItemNotFoundImg;
    if (this.tabList != null) {
      data['tab_list'] = this.tabList.map((v) => v.toJson()).toList();
    }
    if (this.listStyle != null) {
      data['list_style'] = this.listStyle.toJson();
    }
    data['edit_left_confirm_color'] = this.editLeftConfirmColor;
    data['edit_left_no_confirm_color'] = this.editLeftNoConfirmColor;
    if (this.bottom != null) {
      data['bottom'] = this.bottom.toJson();
    }
    if (this.confirmDialog != null) {
      data['confirm_dialog'] = this.confirmDialog.toJson();
    }

    data['tab_name_color'] = this.tabNameColor;
    data['tab_name_selected_color'] = this.tabNameSelectedColor;
    data['edit_left_confirm_icon'] = this.editLeftConfirmIcon;
    data['edit_left_no_confirm_icon'] = this.editLeftNoConfirmIcon;

    return data;
  }
}

class TabList {
  String type;
  String name;
  String nameColor;
  String nameSelectedColor;

  TabList({this.type, this.name, this.nameColor, this.nameSelectedColor});

  TabList.fromJson(Map<String, dynamic> json) {
    type = json['type'];
    name = json['name'];
    nameColor = json['name_color'];
    nameSelectedColor = json['name_selected_color'];
  }

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

class Left {
  String couonText;
  String couponFontColor;
  String couponBgColor;
  String couponBgImg;
  String isImg;

  Left({this.couonText, this.couponFontColor, this.couponBgColor, this.couponBgImg, this.isImg});

  Left.fromJson(Map<String, dynamic> json) {
    couonText = json['couon_text'];
    couponFontColor = json['coupon_font_color'];
    couponBgColor = json['coupon_bg_color'];
    couponBgImg = json['coupon_bg_img'];
    isImg = json['is_img'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['couon_text'] = this.couonText;
    data['coupon_font_color'] = this.couponFontColor;
    data['coupon_bg_color'] = this.couponBgColor;
    data['coupon_bg_img'] = this.couponBgImg;
    data['is_img'] = this.isImg;
    return data;
  }
}

class Right {
  String commissionText;
  String commissionFontColor;
  String commissionBgColor;
  String commissionBgImg;
  String isImg;

  Right({this.commissionText, this.commissionFontColor, this.commissionBgColor, this.commissionBgImg, this.isImg});

  Right.fromJson(Map<String, dynamic> json) {
    commissionText = json['commission_text'];
    commissionFontColor = json['commission_font_color'];
    commissionBgColor = json['commission_bg_color'];
    commissionBgImg = json['commission_bg_img'];
    isImg = json['is_img'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['commission_text'] = this.commissionText;
    data['commission_font_color'] = this.commissionFontColor;
    data['commission_bg_color'] = this.commissionBgColor;
    data['commission_bg_img'] = this.commissionBgImg;
    data['is_img'] = this.isImg;
    return data;
  }
}

class Bottom {
  String bgColor;
  String leftText;
  String leftColor;
  String rightText;
  String rightColor;

  Bottom({this.bgColor, this.leftText, this.leftColor, this.rightText, this.rightColor});

  Bottom.fromJson(Map<String, dynamic> json) {
    bgColor = json['bg_color'];
    leftText = json['left_text'];
    leftColor = json['left_color'];
    rightText = json['right_text'];
    rightColor = json['right_color'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['bg_color'] = this.bgColor;
    data['left_text'] = this.leftText;
    data['left_color'] = this.leftColor;
    data['right_text'] = this.rightText;
    data['right_color'] = this.rightColor;
    return data;
  }
}

class ConfirmDialog {
  String bgText;
  String bgTextColor;
  String bgColor;
  String leftText;
  String leftTextColor;
  String leftBtnBgColor;
  String rightText;
  String rightTextColor;
  String rightBtnBgColor;

  ConfirmDialog({this.bgText, this.bgTextColor, this.bgColor, this.leftText, this.leftTextColor, this.leftBtnBgColor, this.rightText, this.rightTextColor, this.rightBtnBgColor});

  ConfirmDialog.fromJson(Map<String, dynamic> json) {
    bgText = json['bg_text'];
    bgTextColor = json['bg_text_color'];
    bgColor = json['bg_color'];
    leftText = json['left_text'];
    leftTextColor = json['left_text_color'];
    leftBtnBgColor = json['left_btn_bg_color'];
    rightText = json['right_text'];
    rightTextColor = json['right_text_color'];
    rightBtnBgColor = json['right_btn_bg_color'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['bg_text'] = this.bgText;
    data['bg_text_color'] = this.bgTextColor;
    data['bg_color'] = this.bgColor;
    data['left_text'] = this.leftText;
    data['left_text_color'] = this.leftTextColor;
    data['left_btn_bg_color'] = this.leftBtnBgColor;
    data['right_text'] = this.rightText;
    data['right_text_color'] = this.rightTextColor;
    data['right_btn_bg_color'] = this.rightBtnBgColor;
    return data;
  }
}
