/*
 * @Author       : WuWei
 * @LastEditors: ChenYaJin
 * @Date         : 2022-02-09 09:54:51
 * @LastEditTime: 2022-11-22 09:43:33
 * @Description  : Do not edit
 */

class AppPageSettingDetailModel {
  String? id;
  String? displayMode;
  String? selectedIcon;
  String? notSelectedIcon;
  String? name;
  bool? isPreset;
  num? sortNo;
  List<GroupDataOfAppPageSettingDetailModel>? groupData;

  AppPageSettingDetailModel({
    this.id,
    this.displayMode,
    this.selectedIcon,
    this.notSelectedIcon,
    this.name,
    this.isPreset,
    this.sortNo,
    this.groupData,
  });

  AppPageSettingDetailModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});

    id = map['id'];
    displayMode = map['displayMode'];
    selectedIcon = map['selectedIcon'];
    notSelectedIcon = map['notSelectedIcon'];
    name = map['name'];
    isPreset = map['isPreset'];
    sortNo = map['sortNo'];
    groupData = List<GroupDataOfAppPageSettingDetailModel>.from(
        (map["groupData"] ?? [])
            .map((x) => GroupDataOfAppPageSettingDetailModel.fromJson(x)));
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['id'] = this.id;
    json['displayMode'] = this.displayMode;
    json['selectedIcon'] = this.selectedIcon;
    json['notSelectedIcon'] = this.notSelectedIcon;
    json['name'] = this.name;
    json['isPreset'] = this.isPreset;
    json['sortNo'] = this.sortNo;
    json['groupData'] =
        List<dynamic>.from((groupData ?? []).map((x) => x.toJson()));

    return json;
  }
}

class GroupDataOfAppPageSettingDetailModel {
  String? id;
  String? name;
  String? type;
  List<MenusOfGroupDataOfAppPageSettingDetailModel>? menus;

  GroupDataOfAppPageSettingDetailModel({
    this.id,
    this.name,
    this.type,
    this.menus,
  });

  GroupDataOfAppPageSettingDetailModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});

    id = map['id'];
    name = map['name'];
    type = map['type'];
    menus = List<MenusOfGroupDataOfAppPageSettingDetailModel>.from(
        (map["menus"] ?? []).map(
            (x) => MenusOfGroupDataOfAppPageSettingDetailModel.fromJson(x)));
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['id	'] = this.id;
    json['name'] = this.name;
    json['type'] = this.type;
    json['menus'] = List<dynamic>.from((menus ?? []).map((x) => x.toJson()));

    return json;
  }
}

class MenusNoticeModel {
  String? route;
  bool? showBadge; // 是否显示小红点

  MenusNoticeModel({this.route, this.showBadge});

  MenusNoticeModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});
    route = map['route'];
    showBadge = map['showBadge'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['route'] = this.route;
    json['showBadge'] = this.showBadge;

    return json;
  }
}

class MenusOfGroupDataOfAppPageSettingDetailModel {
  String? id;
  String? icon;
  String? name;
  String? route;
  bool? get exist => route != 'menu/closed';
  bool? relationCommunity;
  bool? showBadge; // 是否显示小红点

  MenusOfGroupDataOfAppPageSettingDetailModel({
    this.id,
    this.icon,
    this.name,
    this.route,
    this.relationCommunity,
    this.showBadge,
  });

  MenusOfGroupDataOfAppPageSettingDetailModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});

    id = map['id'];
    icon = map['icon'];
    name = map['name'];
    route = map['route'];
    relationCommunity = map['relationCommunity'];
    showBadge = map['showBadge'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['id'] = this.id;
    json['icon'] = this.icon;
    json['name'] = this.name;
    json['route'] = this.route;
    json['relationCommunity'] = this.relationCommunity;
    json['showBadge'] = this.showBadge;

    return json;
  }
}
