import 'dart:collection';

import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/model/no_goods_dialog_style_model.dart';
import 'package:zhiying_comm/models/base/skip_model.dart';

class MessageNoticeStyleModel {
  bool isFist;
  String styleType;
  String styleTitle;
  String app_bar_bg_color;
  String app_bar_bg_img;
  String app_bar_name;
  String app_bar_name_color;
  MainNotificationStyle main_notification;
  FeedbackNotificationStyle feedback_notification;
  OfficialActivityStyle official_activity;
  OfficialNotificationStyle official_notification;
  PromotionNotificationStyle promotion_notification;
  TransactionNotificationStyle transaction_notification;

  MessageNoticeStyleModel({
    this.isFist,
    this.styleTitle,
    this.styleType,
    this.app_bar_bg_color,
    this.app_bar_bg_img,
    this.app_bar_name,
    this.app_bar_name_color,
    this.feedback_notification,
    this.main_notification,
    this.official_activity,
    this.official_notification,
    this.promotion_notification,
    this.transaction_notification,
  });

  factory MessageNoticeStyleModel.fromJson(Map<String, dynamic> json) {
    return MessageNoticeStyleModel(
      isFist: json['isFist'],
      styleTitle: json['styleTitle'],
      styleType: json['styleType'],
      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'],
      feedback_notification: json['feedback_notification'] != null ? FeedbackNotificationStyle.fromJson(json['feedback_notification']) : null,
      main_notification: json['main'] != null ? MainNotificationStyle.fromJson(json['main']) : null,
      official_activity: json['official_activity'] != null ? OfficialActivityStyle.fromJson(json['official_activity']) : null,
      official_notification: json['official_notification'] != null ? OfficialNotificationStyle.fromJson(json['official_notification']) : null,
      promotion_notification: json['promotion_notification'] != null ? PromotionNotificationStyle.fromJson(json['promotion_notification']) : null,
      transaction_notification: json['transaction_notification'] != null ? TransactionNotificationStyle.fromJson(json['transaction_notification']) : null,
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['isFist'] = this.isFist;
    data['styleTitle'] = this.styleTitle;
    data['styleType'] = this.styleType;
    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;
    if (this.feedback_notification != null) {
      data['feedback_notification'] = this.feedback_notification.toJson();
    }
    if (this.main_notification != null) {
      data['main'] = this.main_notification.toJson();
    }
    if (this.official_activity != null) {
      data['official_activity'] = this.official_activity.toJson();
    }
    if (this.official_notification != null) {
      data['official_notification'] = this.official_notification.toJson();
    }
    if (this.promotion_notification != null) {
      data['promotion_notification'] = this.promotion_notification.toJson();
    }
    if (this.transaction_notification != null) {
      data['transaction_notification'] = this.transaction_notification.toJson();
    }
    return data;
  }
}

class FeedbackNotificationStyle  {
  String bg_color;
  String icon;
  String message_value_color;
  String skip_identifier;
  String time_color;
  String title_value_color;

  FeedbackNotificationStyle({
    this.bg_color,
    this.icon,
    this.message_value_color,
    this.skip_identifier,
    this.time_color,
    this.title_value_color,
  });

  // factory FeedbackNotificationStyle.fromJson(Map<String, dynamic> json) {
  //   return FeedbackNotificationStyle(
  //     bg_color: json['bg_color'],
  //     icon: json['icon'],
  //     message_value_color: json['message_value_color'],
  //     skip_identifier: json['skip_identifier'],
  //     time_color: json['time_color'],
  //     title_value_color: json['title_value_color'],
  //   );
  // }

  FeedbackNotificationStyle.fromJson(Map<String, dynamic> json) {

    bg_color = json['bg_color'];
    icon = json['icon'];
    message_value_color = json['message_value_color'];
    skip_identifier = json['skip_identifier'];
    time_color = json['time_color'];
    title_value_color = json['title_value_color'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new HashMap<String, dynamic>();
    data['bg_color'] = this.bg_color;
    data['icon'] = this.icon;
    data['message_value_color'] = this.message_value_color;
    data['skip_identifier'] = this.skip_identifier;
    data['time_color'] = this.time_color;
    data['title_value_color'] = this.title_value_color;
    return data;
  }
}

class MainNotificationStyle {
  List<MainNotificationStyleItem> list;
  String unread_bg_color;
  String unread_text_color;

  MainNotificationStyle({this.list, this.unread_bg_color, this.unread_text_color});

  factory MainNotificationStyle.fromJson(Map<String, dynamic> json) {
    return MainNotificationStyle(
      list: json['list'] != null ? (json['list'] as List).map((i) => MainNotificationStyleItem.fromJson(i)).toList() : null,
      unread_bg_color: json['unread_bg_color'],
      unread_text_color: json['unread_text_color'],
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['unread_bg_color'] = this.unread_bg_color;
    data['unread_text_color'] = this.unread_text_color;
    if (this.list != null) {
      data['list'] = this.list.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class MainNotificationStyleItem  {
  String bg_color;
  String icon;
  String name;
  String name_color;
  String time_color;
  String type;
  String value_color;

  MainNotificationStyleItem({
    this.bg_color,
    this.icon,
    this.name,
    this.name_color,
    this.time_color,
    this.type,
    this.value_color,
  });

  factory MainNotificationStyleItem.fromJson(Map<String, dynamic> json) {
    return MainNotificationStyleItem(
      bg_color: json['bg_color'],
      icon: json['icon'],
      name: json['name'],
      name_color: json['name_color'],
      time_color: json['time_color'],
      type: json['type'],
      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['icon'] = this.icon;
    data['name'] = this.name;
    data['name_color'] = this.name_color;
    data['time_color'] = this.time_color;
    data['type'] = this.type;
    data['value_color'] = this.value_color;
    return data;
  }
}

class OfficialActivityStyle {
  String bg_color;
  String message_value_color;
  String skip_identifier;
  String time_color;
  String title_value_color;

  OfficialActivityStyle({
    this.bg_color,
    this.message_value_color,
    this.skip_identifier,
    this.time_color,
    this.title_value_color,
  });

  OfficialActivityStyle.fromJson(Map<String, dynamic> json) {
    bg_color = json['bg_color'];
    message_value_color = json['message_value_color'];
    skip_identifier = json['skip_identifier'];
    time_color = json['time_color'];
    title_value_color = json['title_value_color'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new HashMap<String, dynamic>();
    data['bg_color'] = this.bg_color;
    data['message_value_color'] = this.message_value_color;
    data['skip_identifier'] = this.skip_identifier;
    data['time_color'] = this.time_color;
    data['title_value_color'] = this.title_value_color;
    return data;
  }
}

class OfficialNotificationStyle {
  String bg_color;
  String icon;
  String message_value_color;
  String skip_identifier;
  String time_color;
  String title_value_color;

  OfficialNotificationStyle({
    this.bg_color,
    this.icon,
    this.message_value_color,
    this.skip_identifier,
    this.time_color,
    this.title_value_color,
  });

  OfficialNotificationStyle.fromJson(Map<String, dynamic> json) {
    bg_color = json['bg_color'];
    icon = json['icon'];
    message_value_color = json['message_value_color'];
    skip_identifier = json['skip_identifier'];
    time_color = json['time_color'];
    title_value_color = json['title_value_color'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new HashMap<String, dynamic>();
    data['bg_color'] = this.bg_color;
    data['icon'] = this.icon;
    data['message_value_color'] = this.message_value_color;
    data['skip_identifier'] = this.skip_identifier;
    data['time_color'] = this.time_color;
    data['title_value_color'] = this.title_value_color;
    return data;
  }
}

class PromotionNotificationStyle  {
  String bg_color;
  String icon;
  String message_value_color;
  String skip_identifier;
  String time_color;
  String title_value_color;

  PromotionNotificationStyle({
    this.bg_color,
    this.icon,
    this.message_value_color,
    this.skip_identifier,
    this.time_color,
    this.title_value_color,
  });

  // factory PromotionNotificationStyle.fromJson(Map<String, dynamic> json) {
  //   return PromotionNotificationStyle(
  //     bg_color: json['bg_color'],
  //     icon: json['icon'],
  //     message_value_color: json['message_value_color'],
  //     skip_identifier: json['skip_identifier'],
  //     time_color: json['time_color'],
  //     title_value_color: json['title_value_color'],
  //   );
  // }
  PromotionNotificationStyle.fromJson(Map<String, dynamic> json) {
    bg_color = json['bg_color'];
    icon = json['icon'];
    message_value_color = json['message_value_color'];
    skip_identifier = json['skip_identifier'];
    time_color = json['time_color'];
    title_value_color = json['title_value_color'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new HashMap<String, dynamic>();
    data['bg_color'] = this.bg_color;
    data['icon'] = this.icon;
    data['message_value_color'] = this.message_value_color;
    data['skip_identifier'] = this.skip_identifier;
    data['time_color'] = this.time_color;
    data['title_value_color'] = this.title_value_color;
    return data;
  }
}

class TransactionNotificationStyle {
  String bg_color;
  String earnings;
  String icon;
  String message_value_color;
  String skip_identifier;
  String time_color;
  String title_value_color;

  TransactionNotificationStyle({
    this.bg_color,
    this.earnings,
    this.icon,
    this.message_value_color,
    this.skip_identifier,
    this.time_color,
    this.title_value_color,
  });

  // factory TransactionNotificationStyle.fromJson(Map<String, dynamic> json) {
  //   return TransactionNotificationStyle(
  //     bg_color: json['bg_color'],
  //     earnings: json['earnings'],
  //     icon: json['icon'],
  //     message_value_color: json['message_value_color'],
  //     skip_identifier: json['skip_identifier'],
  //     time_color: json['time_color'],
  //     title_value_color: json['title_value_color'],
  //   );
  // }

  TransactionNotificationStyle.fromJson(Map<String, dynamic> json) {
    bg_color = json['bg_color'];
    earnings = json['earnings'];
    icon = json['icon'];
    message_value_color = json['message_value_color'];
    skip_identifier = json['skip_identifier'];
    time_color = json['time_color'];
    title_value_color = json['title_value_color'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new HashMap<String, dynamic>();
    data['bg_color'] = this.bg_color;
    data['earnings'] = this.earnings;
    data['icon'] = this.icon;
    data['message_value_color'] = this.message_value_color;
    data['skip_identifier'] = this.skip_identifier;
    data['time_color'] = this.time_color;
    data['title_value_color'] = this.title_value_color;
    return data;
  }
}
