import 'package:zhiying_base_widget/pages/setting_page/models/setting_page_style_item_model.dart';

class SettingPageStyleModel extends Object {
  String appBarName;
  String appBarNameColor;
  String appBarBgColor;
  String logoutName;
  String logoutNameColor;
  String settingsBgColor;
  List<List<SettingPageStyleItemModel>> settings;

  SettingPageStyleModel(this.appBarName,
      this.appBarNameColor,
      this.appBarBgColor,
      this.logoutName,
      this.logoutNameColor,
      this.settingsBgColor,
      this.settings,);

  factory SettingPageStyleModel.fromJson(Map<String, dynamic> json) {
    var st = (json['settings'] as List).map((list) {
      return (list as List)
          ?.map((item) =>
          SettingPageStyleItemModel.fromJson(
              Map<String, dynamic>.from(item)))
          ?.toList() ??
          [];
    })?.toList();
    return SettingPageStyleModel(
      json['app_bar_name'] as String,
      json['app_bar_name_color'] as String,
      json['app_bar_bg_color'] as String,
      json['logout_name'] as String,
      json['logout_name_color'] as String,
      json['settings_bg_color'] as String,
      st,
    );
  }

  Map<String, dynamic> toJson() {
    return <String, dynamic>{
      'app_bar_name': this.appBarName,
      'app_bar_name_color': this.appBarNameColor,
      'app_bar_bg_color': this.appBarBgColor,
      'logout_name': this.logoutName,
      'logout_name_color': this.logoutNameColor,
      'settings_bg_color': this.settingsBgColor,
      'settings': this.settings,
    };
  }
}
