import 'package:zhiying_base_widget/pages/orders_page/models/order_page_item_style_model.dart';

class OrderPageStyleModel {
  String appBarName;
  String appBarNameColor;
  String appBarBgImg;
  String appBarBgColor;
  String appBgColor;
  String appActivateColor;
  String searchBarLeftIcon;
  String searchBarRightIcon;
  String searchBarPlaceholder;
  String searchBarHideTextColor;
  String searchBarBgColor;
  String searchBarBtnText;
  String searchBarBtnTextColor;
  String searchBarBtnBgColor;
  String searchBtnReset;
  String searchBtnOk;
  String noticeSecurityIcon;
  String noticeSecurityTitle;
  String noticeSecuritySkipTitle;
  String noticeSecuritySkipColor;
  String noticeSecuritySkipIdentifier;
  OrderPageFilterStyleModel filter;
  OrderPageItemStyleModel list;

  OrderPageStyleModel(
      {this.appBarName,
      this.appBarNameColor,
      this.appBarBgImg,
      this.appBarBgColor,
      this.appBgColor,
      this.appActivateColor,
      this.searchBarLeftIcon,
      this.searchBarRightIcon,
      this.searchBarPlaceholder,
      this.searchBarHideTextColor,
      this.searchBarBgColor,
      this.searchBarBtnText,
      this.searchBarBtnTextColor,
      this.searchBarBtnBgColor,
      this.searchBtnReset,
      this.searchBtnOk,
      this.noticeSecurityIcon,
      this.noticeSecurityTitle,
      this.noticeSecuritySkipTitle,
      this.noticeSecuritySkipColor,
      this.noticeSecuritySkipIdentifier,
      this.filter,
      this.list});

  OrderPageStyleModel.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'];
    appBgColor = json['app_bg_color'];
    appActivateColor = json['app_activate_color'];
    searchBarLeftIcon = json['search_bar_left_icon'];
    searchBarRightIcon = json['search_bar_right_icon'];
    searchBarPlaceholder = json['search_bar_placeholder'];
    searchBarHideTextColor = json['search_bar_hide_text_color'];
    searchBarBgColor = json['search_bar_bg_color'];
    searchBarBtnText = json['search_bar_btn_text'];
    searchBarBtnTextColor = json['search_bar_btn_text_color'];
    searchBarBtnBgColor = json['search_bar_btn_bg_color'];
    searchBtnReset = json['search_btn_reset'];
    searchBtnOk = json['search_btn_ok'];
    noticeSecurityIcon = json['notice_security_icon'];
    noticeSecurityTitle = json['notice_security_title'];
    noticeSecuritySkipTitle = json['notice_security_skip_title'];
    noticeSecuritySkipColor = json['notice_security_skip_color'];
    noticeSecuritySkipIdentifier = json['notice_security_skip_identifier'];
    filter = json['filter'] != null
        ? new OrderPageFilterStyleModel.fromJson(json['filter'])
        : null;
    list = json['list'] != null
        ? OrderPageItemStyleModel.fromJson(json['list'])
        : null;
  }

  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_bg_color'] = this.appBgColor;
    data['app_activate_color'] = this.appActivateColor;
    data['search_bar_left_icon'] = this.searchBarLeftIcon;
    data['search_bar_right_icon'] = this.searchBarRightIcon;
    data['search_bar_placeholder'] = this.searchBarPlaceholder;
    data['search_bar_hide_text_color'] = this.searchBarHideTextColor;
    data['search_bar_bg_color'] = this.searchBarBgColor;
    data['search_bar_btn_text'] = this.searchBarBtnText;
    data['search_bar_btn_text_color'] = this.searchBarBtnTextColor;
    data['search_bar_btn_bg_color'] = this.searchBarBtnBgColor;
    data['search_btn_reset'] = this.searchBtnReset;
    data['search_btn_ok'] = this.searchBtnOk;
    data['notice_security_icon'] = this.noticeSecurityIcon;
    data['notice_security_title'] = this.noticeSecurityTitle;
    data['notice_security_skip_title'] = this.noticeSecuritySkipTitle;
    data['notice_security_skip_color'] = this.noticeSecuritySkipColor;
    data['notice_security_skip_identifier'] = this.noticeSecuritySkipIdentifier;
    if (this.filter != null) {
      data['filter'] = this.filter.toJson();
    }
    if (this.list != null) {
      data['list'] = this.list.toJson();
    }
    return data;
  }
}

class OrderPageFilterStyleModel {
  String icon;
  List<OrderTypeModel> orderState;
  String providerTitle;
  List<OrderTypeModel> providerType;
  String orderTitle;
  List<OrderTypeModel> orderType;
  String orderTimeTitle;

  OrderPageFilterStyleModel(
      {this.icon,
      this.orderState,
      this.providerTitle,
      this.providerType,
      this.orderTitle,
      this.orderType,
      this.orderTimeTitle});

  OrderPageFilterStyleModel.fromJson(Map<String, dynamic> json) {
    icon = json['icon'];
    if (json['order_state'] != null) {
      orderState = new List<OrderTypeModel>();
      json['order_state'].forEach((v) {
        orderState.add(new OrderTypeModel.fromJson(v));
      });
    }
    providerTitle = json['provider_title'];
    if (json['provider_type'] != null) {
      providerType = new List<OrderTypeModel>();
      json['provider_type'].forEach((v) {
        providerType.add(new OrderTypeModel.fromJson(v));
      });
    }
    orderTitle = json['order_title'];
    if (json['order_type'] != null) {
      orderType = new List<OrderTypeModel>();
      json['order_type'].forEach((v) {
        orderType.add(new OrderTypeModel.fromJson(v));
      });
    }
    orderTimeTitle = json['order_time_title'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['icon'] = this.icon;
    if (this.orderState != null) {
      data['order_state'] = this.orderState.map((v) => v.toJson()).toList();
    }
    data['provider_title'] = this.providerTitle;
    if (this.providerType != null) {
      data['provider_type'] = this.providerType.map((v) => v.toJson()).toList();
    }
    data['order_title'] = this.orderTitle;
    if (this.orderType != null) {
      data['order_type'] = this.orderType.map((v) => v.toJson()).toList();
    }
    data['order_time_title'] = this.orderTimeTitle;
    return data;
  }
}
