app_style.dart 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. // To parse this JSON data, do
  2. //
  3. // final appStyle = appStyleFromJson(jsonString);
  4. class AppStyle {
  5. AppStyle({
  6. this.portalList,
  7. this.indexType,
  8. this.indexPortal,
  9. this.simpleMode,
  10. this.indexCentered,
  11. this.appIndexPages,
  12. this.processFilterList,
  13. this.cmsCategoryFilterList,
  14. this.contactPermissionView,
  15. this.nativeAppList,
  16. this.images,
  17. this.needGray,
  18. this.appExitAlert,
  19. this.systemMessageCanClick,
  20. this.systemMessageSwitch,
  21. this.speechScript,
  22. this.promotionPageScript,
  23. this.extendParam
  24. });
  25. String? indexType; // 首页展现类型,default是移动端原来的首页,portal是门户. default
  26. String? indexPortal;
  27. bool? simpleMode; // 移动端简易模式
  28. bool? indexCentered; // 首页居中 首页居中 下面的 appIndexPages 就无效了,页面个数就固定了
  29. List<String>? appIndexPages; // 首页展现的 tab 列表
  30. bool? systemMessageSwitch; // 消息列表中 是否显示系统通知
  31. bool? systemMessageCanClick; // 系统消息是否可点击打开
  32. bool? needGray; // 是否启用灰色 默哀
  33. String? appExitAlert; // app退出提示,有提示信息就弹出窗
  34. String? contactPermissionView; // 移动App通讯录权限视图 addressPowerView
  35. List<NativeAppList>? nativeAppList;
  36. List<PortalList>? portalList;
  37. List<AppStyleImage>? images;
  38. List<String>? processFilterList; // 首页办公中心,流程过滤条件.
  39. List<String>? cmsCategoryFilterList; // 首页信息中心,分类过滤条件.
  40. String? speechScript; // 语音助手服务脚本名,如果没有不显示语音助手
  41. String? promotionPageScript; // 推广页
  42. Map<String, dynamic>? extendParam; // 扩展属性
  43. factory AppStyle.fromJson(Map<String, dynamic> json) => AppStyle(
  44. portalList: json["portalList"] == null ? null : List<PortalList>.from(json["portalList"].map((x) => PortalList.fromJson(x))),
  45. indexType: json["indexType"],
  46. indexPortal: json["indexPortal"],
  47. simpleMode: json["simpleMode"],
  48. indexCentered: json["indexCentered"],
  49. appIndexPages: json["appIndexPages"] == null ? null : List<String>.from(json['appIndexPages'].map((e)=> e)),
  50. needGray: json["needGray"],
  51. appExitAlert: json["appExitAlert"],
  52. systemMessageSwitch: json["systemMessageSwitch"],
  53. systemMessageCanClick: json["systemMessageCanClick"],
  54. contactPermissionView: json["contactPermissionView"],
  55. speechScript: json["speechScript"],
  56. promotionPageScript: json["promotionPageScript"],
  57. nativeAppList: json["nativeAppList"] == null ? null : List<NativeAppList>.from(json["nativeAppList"].map((x) => NativeAppList.fromJson(x))),
  58. images: json["images"] == null ? null : List<AppStyleImage>.from(json["images"].map((x) => AppStyleImage.fromJson(x))),
  59. processFilterList: json["processFilterList"] == null ? null : List<String>.from(json['processFilterList'].map((e)=> e)),
  60. cmsCategoryFilterList: json["cmsCategoryFilterList"] == null ? null : List<String>.from(json['cmsCategoryFilterList'].map((e)=> e)),
  61. extendParam: json["extendParam"]
  62. );
  63. Map<String, dynamic> toJson() => {
  64. "portalList": portalList == null ? null : List<dynamic>.from(portalList!.map((x) => x.toJson())),
  65. "indexType": indexType,
  66. "indexPortal": indexPortal,
  67. "appIndexPages": appIndexPages,
  68. "simpleMode": simpleMode,
  69. "indexCentered": indexCentered,
  70. "needGray": needGray,
  71. "appExitAlert": appExitAlert,
  72. "systemMessageSwitch": systemMessageSwitch,
  73. "systemMessageCanClick": systemMessageCanClick,
  74. "contactPermissionView": contactPermissionView,
  75. "speechScript": speechScript,
  76. "promotionPageScript": promotionPageScript,
  77. "nativeAppList": nativeAppList == null ? null : List<dynamic>.from(nativeAppList!.map((x) => x.toJson())),
  78. "images": images == null ? null : List<dynamic>.from(images!.map((x) => x.toJson())),
  79. "processFilterList": processFilterList,
  80. "cmsCategoryFilterList": cmsCategoryFilterList,
  81. "extendParam": extendParam
  82. };
  83. }
  84. class ExtendParamHomeTabPortal {
  85. String? portalId;
  86. bool? hiddenAppBar;
  87. String? appBarTitle;
  88. String? pageId;
  89. String? portalParameters;
  90. ExtendParamHomeTabPortal({this.portalId, this.hiddenAppBar, this.appBarTitle, this.pageId, this.portalParameters});
  91. factory ExtendParamHomeTabPortal.fromJson(Map<String, dynamic> json) => ExtendParamHomeTabPortal(
  92. portalId: json["portalId"],
  93. hiddenAppBar: json["hiddenAppBar"],
  94. appBarTitle: json["appBarTitle"],
  95. pageId: json["pageId"],
  96. portalParameters: json["portalParameters"],
  97. );
  98. Map<String, dynamic> toJson() => {
  99. "portalId": portalId,
  100. "hiddenAppBar": hiddenAppBar,
  101. "appBarTitle": appBarTitle,
  102. "pageId": pageId,
  103. "portalParameters": portalParameters,
  104. };
  105. }
  106. class AppStyleImage {
  107. AppStyleImage({
  108. this.name,
  109. this.value,
  110. this.path
  111. });
  112. String? name;
  113. String? value;
  114. String? path; // 在线图片 相对地址 如 x_desktop/img/abc.png
  115. factory AppStyleImage.fromJson(Map<String, dynamic> json) => AppStyleImage(
  116. name: json["name"],
  117. value: json["value"],
  118. path: json["path"],
  119. );
  120. Map<String, dynamic> toJson() => {
  121. "name": name,
  122. "value": value,
  123. "path": path,
  124. };
  125. }
  126. class NativeAppList {
  127. NativeAppList({
  128. this.id,
  129. this.key,
  130. this.name,
  131. this.displayName,
  132. this.enable,
  133. this.iOs,
  134. });
  135. int? id;
  136. String? key;
  137. String? name;
  138. String? displayName; // 显示名 如果没有内容就用源码中的国际化名称
  139. bool? enable;
  140. IOs? iOs;
  141. factory NativeAppList.fromJson(Map<String, dynamic> json) => NativeAppList(
  142. id: json["id"],
  143. key: json["key"],
  144. name: json["name"],
  145. displayName: json["displayName"],
  146. enable: json["enable"],
  147. iOs: json["iOS"] == null ? null : IOs.fromJson(json["iOS"]),
  148. );
  149. Map<String, dynamic> toJson() => {
  150. "id": id,
  151. "key": key,
  152. "name": name,
  153. "displayName": displayName,
  154. "enable": enable,
  155. "iOS": iOs == null ? null : iOs!.toJson(),
  156. };
  157. }
  158. class IOs {
  159. IOs({
  160. this.category,
  161. this.subcategory,
  162. this.storyboard,
  163. this.vcname,
  164. });
  165. Category? category;
  166. Subcategory? subcategory;
  167. String? storyboard;
  168. Vcname? vcname;
  169. factory IOs.fromJson(Map<String, dynamic> json) => IOs(
  170. category: json["category"] == null ? null : categoryValues.map[json["category"]],
  171. subcategory: json["subcategory"] == null ? null : subcategoryValues.map[json["subcategory"]],
  172. storyboard: json["storyboard"],
  173. vcname: json["vcname"] == null ? null : vcnameValues.map[json["vcname"]],
  174. );
  175. Map<String, dynamic> toJson() => {
  176. "category": category == null ? null : categoryValues.reverse[category],
  177. "subcategory": subcategory == null ? null : subcategoryValues.reverse[subcategory],
  178. "storyboard": storyboard,
  179. "vcname": vcname == null ? null : vcnameValues.reverse[vcname],
  180. };
  181. }
  182. enum Category { NATIVE }
  183. final categoryValues = EnumValues({
  184. "native": Category.NATIVE
  185. });
  186. enum Subcategory { CODING }
  187. final subcategoryValues = EnumValues({
  188. "coding": Subcategory.CODING
  189. });
  190. enum Vcname { TODO_TASK, EMPTY }
  191. final vcnameValues = EnumValues({
  192. "": Vcname.EMPTY,
  193. "todoTask": Vcname.TODO_TASK
  194. });
  195. class PortalList {
  196. PortalList({
  197. this.id,
  198. this.name,
  199. this.alias,
  200. this.description,
  201. this.portalCategory,
  202. this.firstPage,
  203. this.creatorPerson,
  204. this.lastUpdatePerson,
  205. this.pcClient,
  206. this.mobileClient,
  207. });
  208. String? id;
  209. String? name;
  210. String? alias;
  211. String? description;
  212. String? portalCategory;
  213. String? firstPage;
  214. String? creatorPerson;
  215. String? lastUpdatePerson;
  216. bool? pcClient;
  217. bool? mobileClient;
  218. factory PortalList.fromJson(Map<String, dynamic> json) => PortalList(
  219. id: json["id"],
  220. name: json["name"] ,
  221. alias: json["alias"],
  222. description: json["description"],
  223. portalCategory: json["portalCategory"],
  224. firstPage: json["firstPage"],
  225. creatorPerson: json["creatorPerson"],
  226. lastUpdatePerson: json["lastUpdatePerson"],
  227. pcClient: json["pcClient"],
  228. mobileClient: json["mobileClient"],
  229. );
  230. Map<String, dynamic> toJson() => {
  231. "id": id,
  232. "name": name,
  233. "alias": alias,
  234. "description": description,
  235. "portalCategory": portalCategory,
  236. "firstPage": firstPage,
  237. "creatorPerson": creatorPerson,
  238. "lastUpdatePerson": lastUpdatePerson,
  239. "pcClient": pcClient,
  240. "mobileClient": mobileClient,
  241. };
  242. }
  243. class EnumValues<T> {
  244. Map<String, T> map;
  245. Map<T, String>? reverseMap;
  246. EnumValues(this.map);
  247. Map<T, String> get reverse {
  248. reverseMap ??= map.map((k, v) => MapEntry(v, k));
  249. return reverseMap!;
  250. }
  251. }