json_convert_content.dart 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690
  1. // ignore_for_file: non_constant_identifier_names
  2. // ignore_for_file: camel_case_types
  3. // ignore_for_file: prefer_single_quotes
  4. // This file is automatically generated. DO NOT EDIT, all your changes would be lost.
  5. import 'package:flutter/material.dart' show debugPrint;
  6. import 'package:domain/entity/auth_login_entity.dart';
  7. import 'package:domain/entity/captcha_img_entity.dart';
  8. import 'package:domain/entity/facility_book_entity.dart';
  9. import 'package:domain/entity/facility_index_entity.dart';
  10. import 'package:domain/entity/facility_page_entity.dart';
  11. import 'package:domain/entity/feedback_detail_entity.dart';
  12. import 'package:domain/entity/feedback_list_entity.dart';
  13. import 'package:domain/entity/form_content_entity.dart';
  14. import 'package:domain/entity/form_detail_entity.dart';
  15. import 'package:domain/entity/form_list_entity.dart';
  16. import 'package:domain/entity/form_option_entity.dart';
  17. import 'package:domain/entity/form_submitted_entity.dart';
  18. import 'package:domain/entity/form_submitted_page_entity.dart';
  19. import 'package:domain/entity/garage_sale_rent_detail_entity.dart';
  20. import 'package:domain/entity/garage_sale_rent_entity.dart';
  21. import 'package:domain/entity/home_list_entity.dart';
  22. import 'package:domain/entity/id_name_entity.dart';
  23. import 'package:domain/entity/latest_news_detail_entity.dart';
  24. import 'package:domain/entity/latest_news_page_entity.dart';
  25. import 'package:domain/entity/myfollowing_list_entity.dart';
  26. import 'package:domain/entity/myposts_newsfeed_entity.dart';
  27. import 'package:domain/entity/myposts_sale_rent_entity.dart';
  28. import 'package:domain/entity/newsfeed_comment_publish_entity.dart';
  29. import 'package:domain/entity/newsfeed_detail_entity.dart';
  30. import 'package:domain/entity/newsfeed_following_entity.dart';
  31. import 'package:domain/entity/newsfeed_foryou_entity.dart';
  32. import 'package:domain/entity/newsfeed_news_entity.dart';
  33. import 'package:domain/entity/notice_board_announ_detail_entity.dart';
  34. import 'package:domain/entity/notice_board_announ_entity.dart';
  35. import 'package:domain/entity/notice_board_documents_entity.dart';
  36. import 'package:domain/entity/notice_board_event_detail_entity.dart';
  37. import 'package:domain/entity/notice_board_event_entity.dart';
  38. import 'package:domain/entity/payment_page_entity.dart';
  39. import 'package:domain/entity/property_news_detail_entity.dart';
  40. import 'package:domain/entity/property_news_entity.dart';
  41. import 'package:domain/entity/property_sale_rent_entity.dart';
  42. import 'package:domain/entity/rewards_active_detail_entity.dart';
  43. import 'package:domain/entity/rewards_buy_entity.dart';
  44. import 'package:domain/entity/rewards_category_entity.dart';
  45. import 'package:domain/entity/rewards_detail_entity.dart';
  46. import 'package:domain/entity/rewards_history_earned_entity.dart';
  47. import 'package:domain/entity/rewards_home_entity.dart';
  48. import 'package:domain/entity/rewards_home_tes_entity.dart';
  49. import 'package:domain/entity/rewards_home_test_entity.dart';
  50. import 'package:domain/entity/rewards_home_tx_entity.dart';
  51. import 'package:domain/entity/rewards_index_entity.dart';
  52. import 'package:domain/entity/rewards_list_entity.dart';
  53. import 'package:domain/entity/rewards_my_detail_entity.dart';
  54. import 'package:domain/entity/rewards_my_entity.dart';
  55. import 'package:domain/entity/rewards_search_entity.dart';
  56. import 'package:domain/entity/server_time.dart';
  57. import 'package:domain/entity/text_kon_entity.dart';
  58. import 'package:domain/entity/user_me_entity.dart';
  59. import 'package:domain/entity/visitor_page_entity.dart';
  60. JsonConvert jsonConvert = JsonConvert();
  61. typedef JsonConvertFunction<T> = T Function(Map<String, dynamic> json);
  62. typedef EnumConvertFunction<T> = T Function(String value);
  63. typedef ConvertExceptionHandler = void Function(Object error, StackTrace stackTrace);
  64. extension MapSafeExt<K, V> on Map<K, V> {
  65. T? getOrNull<T>(K? key) {
  66. if (!containsKey(key) || key == null) {
  67. return null;
  68. } else {
  69. return this[key] as T?;
  70. }
  71. }
  72. }
  73. class JsonConvert {
  74. static ConvertExceptionHandler? onError;
  75. JsonConvertClassCollection convertFuncMap = JsonConvertClassCollection();
  76. /// When you are in the development, to generate a new model class, hot-reload doesn't find new generation model class, you can build on MaterialApp method called jsonConvert. ReassembleConvertFuncMap (); This method only works in a development environment
  77. /// https://flutter.cn/docs/development/tools/hot-reload
  78. /// class MyApp extends StatelessWidget {
  79. /// const MyApp({Key? key})
  80. /// : super(key: key);
  81. ///
  82. /// @override
  83. /// Widget build(BuildContext context) {
  84. /// jsonConvert.reassembleConvertFuncMap();
  85. /// return MaterialApp();
  86. /// }
  87. /// }
  88. void reassembleConvertFuncMap() {
  89. bool isReleaseMode = const bool.fromEnvironment('dart.vm.product');
  90. if (!isReleaseMode) {
  91. convertFuncMap = JsonConvertClassCollection();
  92. }
  93. }
  94. T? convert<T>(dynamic value, {EnumConvertFunction? enumConvert}) {
  95. if (value == null) {
  96. return null;
  97. }
  98. if (value is T) {
  99. return value;
  100. }
  101. try {
  102. return _asT<T>(value, enumConvert: enumConvert);
  103. } catch (e, stackTrace) {
  104. debugPrint('asT<$T> $e $stackTrace');
  105. if (onError != null) {
  106. onError!(e, stackTrace);
  107. }
  108. return null;
  109. }
  110. }
  111. List<T?>? convertList<T>(List<dynamic>? value, {EnumConvertFunction? enumConvert}) {
  112. if (value == null) {
  113. return null;
  114. }
  115. try {
  116. return value.map((dynamic e) => _asT<T>(e, enumConvert: enumConvert)).toList();
  117. } catch (e, stackTrace) {
  118. debugPrint('asT<$T> $e $stackTrace');
  119. if (onError != null) {
  120. onError!(e, stackTrace);
  121. }
  122. return <T>[];
  123. }
  124. }
  125. List<T>? convertListNotNull<T>(dynamic value, {EnumConvertFunction? enumConvert}) {
  126. if (value == null) {
  127. return null;
  128. }
  129. try {
  130. return (value as List<dynamic>).map((dynamic e) => _asT<T>(e, enumConvert: enumConvert)!).toList();
  131. } catch (e, stackTrace) {
  132. debugPrint('asT<$T> $e $stackTrace');
  133. if (onError != null) {
  134. onError!(e, stackTrace);
  135. }
  136. return <T>[];
  137. }
  138. }
  139. T? _asT<T extends Object?>(dynamic value,
  140. {EnumConvertFunction? enumConvert}) {
  141. final String type = T.toString();
  142. final String valueS = value.toString();
  143. if (enumConvert != null) {
  144. return enumConvert(valueS) as T;
  145. } else if (type == "String") {
  146. return valueS as T;
  147. } else if (type == "int") {
  148. final int? intValue = int.tryParse(valueS);
  149. if (intValue == null) {
  150. return double.tryParse(valueS)?.toInt() as T?;
  151. } else {
  152. return intValue as T;
  153. }
  154. } else if (type == "double") {
  155. return double.parse(valueS) as T;
  156. } else if (type == "DateTime") {
  157. return DateTime.parse(valueS) as T;
  158. } else if (type == "bool") {
  159. if (valueS == '0' || valueS == '1') {
  160. return (valueS == '1') as T;
  161. }
  162. return (valueS == 'true') as T;
  163. } else if (type == "Map" || type.startsWith("Map<")) {
  164. return value as T;
  165. } else {
  166. if (convertFuncMap.containsKey(type)) {
  167. if (value == null) {
  168. return null;
  169. }
  170. var covertFunc = convertFuncMap[type]!;
  171. if (covertFunc is Map<String, dynamic>) {
  172. return covertFunc(value as Map<String, dynamic>) as T;
  173. } else {
  174. return covertFunc(Map<String, dynamic>.from(value)) as T;
  175. }
  176. } else {
  177. throw UnimplementedError('$type unimplemented,you can try running the app again');
  178. }
  179. }
  180. }
  181. //list is returned by type
  182. static M? _getListChildType<M>(List<Map<String, dynamic>> data) {
  183. if (<AuthLoginEntity>[] is M) {
  184. return data.map<AuthLoginEntity>((Map<String, dynamic> e) => AuthLoginEntity.fromJson(e)).toList() as M;
  185. }
  186. if (<CaptchaImgEntity>[] is M) {
  187. return data.map<CaptchaImgEntity>((Map<String, dynamic> e) => CaptchaImgEntity.fromJson(e)).toList() as M;
  188. }
  189. if (<FacilityBookEntity>[] is M) {
  190. return data.map<FacilityBookEntity>((Map<String, dynamic> e) => FacilityBookEntity.fromJson(e)).toList() as M;
  191. }
  192. if (<FacilityBookFacilityType>[] is M) {
  193. return data.map<FacilityBookFacilityType>((Map<String, dynamic> e) => FacilityBookFacilityType.fromJson(e)).toList() as M;
  194. }
  195. if (<FacilityBookFacilities>[] is M) {
  196. return data.map<FacilityBookFacilities>((Map<String, dynamic> e) => FacilityBookFacilities.fromJson(e)).toList() as M;
  197. }
  198. if (<FacilityBookFacilitiesPeriods>[] is M) {
  199. return data.map<FacilityBookFacilitiesPeriods>((Map<String, dynamic> e) => FacilityBookFacilitiesPeriods.fromJson(e)).toList() as M;
  200. }
  201. if (<FacilityIndexEntity>[] is M) {
  202. return data.map<FacilityIndexEntity>((Map<String, dynamic> e) => FacilityIndexEntity.fromJson(e)).toList() as M;
  203. }
  204. if (<FacilityPageEntity>[] is M) {
  205. return data.map<FacilityPageEntity>((Map<String, dynamic> e) => FacilityPageEntity.fromJson(e)).toList() as M;
  206. }
  207. if (<FacilityDetail>[] is M) {
  208. return data.map<FacilityDetail>((Map<String, dynamic> e) => FacilityDetail.fromJson(e)).toList() as M;
  209. }
  210. if (<FacilityPageListBooking>[] is M) {
  211. return data.map<FacilityPageListBooking>((Map<String, dynamic> e) => FacilityPageListBooking.fromJson(e)).toList() as M;
  212. }
  213. if (<FacilityPageListFacility>[] is M) {
  214. return data.map<FacilityPageListFacility>((Map<String, dynamic> e) => FacilityPageListFacility.fromJson(e)).toList() as M;
  215. }
  216. if (<FacilityPageListFacilityType>[] is M) {
  217. return data.map<FacilityPageListFacilityType>((Map<String, dynamic> e) => FacilityPageListFacilityType.fromJson(e)).toList() as M;
  218. }
  219. if (<FacilityPageListTimePeriod>[] is M) {
  220. return data.map<FacilityPageListTimePeriod>((Map<String, dynamic> e) => FacilityPageListTimePeriod.fromJson(e)).toList() as M;
  221. }
  222. if (<FacilityPageListAccount>[] is M) {
  223. return data.map<FacilityPageListAccount>((Map<String, dynamic> e) => FacilityPageListAccount.fromJson(e)).toList() as M;
  224. }
  225. if (<FeedbackDetailEntity>[] is M) {
  226. return data.map<FeedbackDetailEntity>((Map<String, dynamic> e) => FeedbackDetailEntity.fromJson(e)).toList() as M;
  227. }
  228. if (<FeedbackDetailReplies>[] is M) {
  229. return data.map<FeedbackDetailReplies>((Map<String, dynamic> e) => FeedbackDetailReplies.fromJson(e)).toList() as M;
  230. }
  231. if (<FeedbackListEntity>[] is M) {
  232. return data.map<FeedbackListEntity>((Map<String, dynamic> e) => FeedbackListEntity.fromJson(e)).toList() as M;
  233. }
  234. if (<FeedbackItemEntity>[] is M) {
  235. return data.map<FeedbackItemEntity>((Map<String, dynamic> e) => FeedbackItemEntity.fromJson(e)).toList() as M;
  236. }
  237. if (<FormContentEntity>[] is M) {
  238. return data.map<FormContentEntity>((Map<String, dynamic> e) => FormContentEntity.fromJson(e)).toList() as M;
  239. }
  240. if (<FormDetailEntity>[] is M) {
  241. return data.map<FormDetailEntity>((Map<String, dynamic> e) => FormDetailEntity.fromJson(e)).toList() as M;
  242. }
  243. if (<FormListEntity>[] is M) {
  244. return data.map<FormListEntity>((Map<String, dynamic> e) => FormListEntity.fromJson(e)).toList() as M;
  245. }
  246. if (<FormOptionEntity>[] is M) {
  247. return data.map<FormOptionEntity>((Map<String, dynamic> e) => FormOptionEntity.fromJson(e)).toList() as M;
  248. }
  249. if (<FormSubmittedEntity>[] is M) {
  250. return data.map<FormSubmittedEntity>((Map<String, dynamic> e) => FormSubmittedEntity.fromJson(e)).toList() as M;
  251. }
  252. if (<FormSubmittedEstateOnlineForm>[] is M) {
  253. return data.map<FormSubmittedEstateOnlineForm>((Map<String, dynamic> e) => FormSubmittedEstateOnlineForm.fromJson(e)).toList() as M;
  254. }
  255. if (<FormSubmittedPageEntity>[] is M) {
  256. return data.map<FormSubmittedPageEntity>((Map<String, dynamic> e) => FormSubmittedPageEntity.fromJson(e)).toList() as M;
  257. }
  258. if (<GarageSaleRentDetailEntity>[] is M) {
  259. return data.map<GarageSaleRentDetailEntity>((Map<String, dynamic> e) => GarageSaleRentDetailEntity.fromJson(e)).toList() as M;
  260. }
  261. if (<GarageSaleRentDetailAccount>[] is M) {
  262. return data.map<GarageSaleRentDetailAccount>((Map<String, dynamic> e) => GarageSaleRentDetailAccount.fromJson(e)).toList() as M;
  263. }
  264. if (<GarageSaleRentEntity>[] is M) {
  265. return data.map<GarageSaleRentEntity>((Map<String, dynamic> e) => GarageSaleRentEntity.fromJson(e)).toList() as M;
  266. }
  267. if (<GarageSaleRentList>[] is M) {
  268. return data.map<GarageSaleRentList>((Map<String, dynamic> e) => GarageSaleRentList.fromJson(e)).toList() as M;
  269. }
  270. if (<GarageSaleRentListAccount>[] is M) {
  271. return data.map<GarageSaleRentListAccount>((Map<String, dynamic> e) => GarageSaleRentListAccount.fromJson(e)).toList() as M;
  272. }
  273. if (<HomeListEntity>[] is M) {
  274. return data.map<HomeListEntity>((Map<String, dynamic> e) => HomeListEntity.fromJson(e)).toList() as M;
  275. }
  276. if (<HomeListBanners>[] is M) {
  277. return data.map<HomeListBanners>((Map<String, dynamic> e) => HomeListBanners.fromJson(e)).toList() as M;
  278. }
  279. if (<HomeListLatestTransactions>[] is M) {
  280. return data.map<HomeListLatestTransactions>((Map<String, dynamic> e) => HomeListLatestTransactions.fromJson(e)).toList() as M;
  281. }
  282. if (<HomeListPropertyNews>[] is M) {
  283. return data.map<HomeListPropertyNews>((Map<String, dynamic> e) => HomeListPropertyNews.fromJson(e)).toList() as M;
  284. }
  285. if (<IdNameEntity>[] is M) {
  286. return data.map<IdNameEntity>((Map<String, dynamic> e) => IdNameEntity.fromJson(e)).toList() as M;
  287. }
  288. if (<LatestNewsDetailEntity>[] is M) {
  289. return data.map<LatestNewsDetailEntity>((Map<String, dynamic> e) => LatestNewsDetailEntity.fromJson(e)).toList() as M;
  290. }
  291. if (<LatestNewsPageEntity>[] is M) {
  292. return data.map<LatestNewsPageEntity>((Map<String, dynamic> e) => LatestNewsPageEntity.fromJson(e)).toList() as M;
  293. }
  294. if (<LatestNewsList>[] is M) {
  295. return data.map<LatestNewsList>((Map<String, dynamic> e) => LatestNewsList.fromJson(e)).toList() as M;
  296. }
  297. if (<MyfollowingListEntity>[] is M) {
  298. return data.map<MyfollowingListEntity>((Map<String, dynamic> e) => MyfollowingListEntity.fromJson(e)).toList() as M;
  299. }
  300. if (<MypostsNewsfeedEntity>[] is M) {
  301. return data.map<MypostsNewsfeedEntity>((Map<String, dynamic> e) => MypostsNewsfeedEntity.fromJson(e)).toList() as M;
  302. }
  303. if (<MypostsNewsfeedList>[] is M) {
  304. return data.map<MypostsNewsfeedList>((Map<String, dynamic> e) => MypostsNewsfeedList.fromJson(e)).toList() as M;
  305. }
  306. if (<MypostsNewsfeedListAccount>[] is M) {
  307. return data.map<MypostsNewsfeedListAccount>((Map<String, dynamic> e) => MypostsNewsfeedListAccount.fromJson(e)).toList() as M;
  308. }
  309. if (<MypostsSaleRentEntity>[] is M) {
  310. return data.map<MypostsSaleRentEntity>((Map<String, dynamic> e) => MypostsSaleRentEntity.fromJson(e)).toList() as M;
  311. }
  312. if (<MypostsSaleRentList>[] is M) {
  313. return data.map<MypostsSaleRentList>((Map<String, dynamic> e) => MypostsSaleRentList.fromJson(e)).toList() as M;
  314. }
  315. if (<NewsfeedCommentPublishEntity>[] is M) {
  316. return data.map<NewsfeedCommentPublishEntity>((Map<String, dynamic> e) => NewsfeedCommentPublishEntity.fromJson(e)).toList() as M;
  317. }
  318. if (<NewsfeedDetailEntity>[] is M) {
  319. return data.map<NewsfeedDetailEntity>((Map<String, dynamic> e) => NewsfeedDetailEntity.fromJson(e)).toList() as M;
  320. }
  321. if (<NewsfeedDetailAccount>[] is M) {
  322. return data.map<NewsfeedDetailAccount>((Map<String, dynamic> e) => NewsfeedDetailAccount.fromJson(e)).toList() as M;
  323. }
  324. if (<NewsfeedDetailComments>[] is M) {
  325. return data.map<NewsfeedDetailComments>((Map<String, dynamic> e) => NewsfeedDetailComments.fromJson(e)).toList() as M;
  326. }
  327. if (<NewsfeedDetailCommentsAccount>[] is M) {
  328. return data.map<NewsfeedDetailCommentsAccount>((Map<String, dynamic> e) => NewsfeedDetailCommentsAccount.fromJson(e)).toList() as M;
  329. }
  330. if (<NewsfeedDetailCommentsToAccount>[] is M) {
  331. return data.map<NewsfeedDetailCommentsToAccount>((Map<String, dynamic> e) => NewsfeedDetailCommentsToAccount.fromJson(e)).toList() as M;
  332. }
  333. if (<NewsfeedFollowingEntity>[] is M) {
  334. return data.map<NewsfeedFollowingEntity>((Map<String, dynamic> e) => NewsfeedFollowingEntity.fromJson(e)).toList() as M;
  335. }
  336. if (<NewsfeedFollowingList>[] is M) {
  337. return data.map<NewsfeedFollowingList>((Map<String, dynamic> e) => NewsfeedFollowingList.fromJson(e)).toList() as M;
  338. }
  339. if (<NewsfeedFollowingListAccount>[] is M) {
  340. return data.map<NewsfeedFollowingListAccount>((Map<String, dynamic> e) => NewsfeedFollowingListAccount.fromJson(e)).toList() as M;
  341. }
  342. if (<NewsfeedForyouEntity>[] is M) {
  343. return data.map<NewsfeedForyouEntity>((Map<String, dynamic> e) => NewsfeedForyouEntity.fromJson(e)).toList() as M;
  344. }
  345. if (<NewsfeedForyouList>[] is M) {
  346. return data.map<NewsfeedForyouList>((Map<String, dynamic> e) => NewsfeedForyouList.fromJson(e)).toList() as M;
  347. }
  348. if (<NewsfeedForyouListAccount>[] is M) {
  349. return data.map<NewsfeedForyouListAccount>((Map<String, dynamic> e) => NewsfeedForyouListAccount.fromJson(e)).toList() as M;
  350. }
  351. if (<NewsfeedNewsEntity>[] is M) {
  352. return data.map<NewsfeedNewsEntity>((Map<String, dynamic> e) => NewsfeedNewsEntity.fromJson(e)).toList() as M;
  353. }
  354. if (<NewsfeedNewsList>[] is M) {
  355. return data.map<NewsfeedNewsList>((Map<String, dynamic> e) => NewsfeedNewsList.fromJson(e)).toList() as M;
  356. }
  357. if (<NewsfeedNewsListAccount>[] is M) {
  358. return data.map<NewsfeedNewsListAccount>((Map<String, dynamic> e) => NewsfeedNewsListAccount.fromJson(e)).toList() as M;
  359. }
  360. if (<NoticeBoardAnnounDetailEntity>[] is M) {
  361. return data.map<NoticeBoardAnnounDetailEntity>((Map<String, dynamic> e) => NoticeBoardAnnounDetailEntity.fromJson(e)).toList() as M;
  362. }
  363. if (<NoticeBoardAnnounEntity>[] is M) {
  364. return data.map<NoticeBoardAnnounEntity>((Map<String, dynamic> e) => NoticeBoardAnnounEntity.fromJson(e)).toList() as M;
  365. }
  366. if (<NoticeBoardAnnounList>[] is M) {
  367. return data.map<NoticeBoardAnnounList>((Map<String, dynamic> e) => NoticeBoardAnnounList.fromJson(e)).toList() as M;
  368. }
  369. if (<NoticeBoardDocumentsEntity>[] is M) {
  370. return data.map<NoticeBoardDocumentsEntity>((Map<String, dynamic> e) => NoticeBoardDocumentsEntity.fromJson(e)).toList() as M;
  371. }
  372. if (<NoticeBoardDocumentsList>[] is M) {
  373. return data.map<NoticeBoardDocumentsList>((Map<String, dynamic> e) => NoticeBoardDocumentsList.fromJson(e)).toList() as M;
  374. }
  375. if (<NoticeBoardEventDetailEntity>[] is M) {
  376. return data.map<NoticeBoardEventDetailEntity>((Map<String, dynamic> e) => NoticeBoardEventDetailEntity.fromJson(e)).toList() as M;
  377. }
  378. if (<NoticeBoardEventEntity>[] is M) {
  379. return data.map<NoticeBoardEventEntity>((Map<String, dynamic> e) => NoticeBoardEventEntity.fromJson(e)).toList() as M;
  380. }
  381. if (<NoticeBoardEventList>[] is M) {
  382. return data.map<NoticeBoardEventList>((Map<String, dynamic> e) => NoticeBoardEventList.fromJson(e)).toList() as M;
  383. }
  384. if (<PaymentPageEntity>[] is M) {
  385. return data.map<PaymentPageEntity>((Map<String, dynamic> e) => PaymentPageEntity.fromJson(e)).toList() as M;
  386. }
  387. if (<PaymentPageList>[] is M) {
  388. return data.map<PaymentPageList>((Map<String, dynamic> e) => PaymentPageList.fromJson(e)).toList() as M;
  389. }
  390. if (<PropertyNewsDetailEntity>[] is M) {
  391. return data.map<PropertyNewsDetailEntity>((Map<String, dynamic> e) => PropertyNewsDetailEntity.fromJson(e)).toList() as M;
  392. }
  393. if (<PropertyNewsEntity>[] is M) {
  394. return data.map<PropertyNewsEntity>((Map<String, dynamic> e) => PropertyNewsEntity.fromJson(e)).toList() as M;
  395. }
  396. if (<PropertyNewsList>[] is M) {
  397. return data.map<PropertyNewsList>((Map<String, dynamic> e) => PropertyNewsList.fromJson(e)).toList() as M;
  398. }
  399. if (<PropertySaleRentEntity>[] is M) {
  400. return data.map<PropertySaleRentEntity>((Map<String, dynamic> e) => PropertySaleRentEntity.fromJson(e)).toList() as M;
  401. }
  402. if (<PropertySaleRentList>[] is M) {
  403. return data.map<PropertySaleRentList>((Map<String, dynamic> e) => PropertySaleRentList.fromJson(e)).toList() as M;
  404. }
  405. if (<RewardsActiveDetailEntity>[] is M) {
  406. return data.map<RewardsActiveDetailEntity>((Map<String, dynamic> e) => RewardsActiveDetailEntity.fromJson(e)).toList() as M;
  407. }
  408. if (<RewardsActiveDetailData>[] is M) {
  409. return data.map<RewardsActiveDetailData>((Map<String, dynamic> e) => RewardsActiveDetailData.fromJson(e)).toList() as M;
  410. }
  411. if (<RewardsActiveDetailDataAccount>[] is M) {
  412. return data.map<RewardsActiveDetailDataAccount>((Map<String, dynamic> e) => RewardsActiveDetailDataAccount.fromJson(e)).toList() as M;
  413. }
  414. if (<RewardsActiveDetailDataReward>[] is M) {
  415. return data.map<RewardsActiveDetailDataReward>((Map<String, dynamic> e) => RewardsActiveDetailDataReward.fromJson(e)).toList() as M;
  416. }
  417. if (<RewardsBuyEntity>[] is M) {
  418. return data.map<RewardsBuyEntity>((Map<String, dynamic> e) => RewardsBuyEntity.fromJson(e)).toList() as M;
  419. }
  420. if (<RewardsBuyReward>[] is M) {
  421. return data.map<RewardsBuyReward>((Map<String, dynamic> e) => RewardsBuyReward.fromJson(e)).toList() as M;
  422. }
  423. if (<RewardsBuyRewardRedeemable>[] is M) {
  424. return data.map<RewardsBuyRewardRedeemable>((Map<String, dynamic> e) => RewardsBuyRewardRedeemable.fromJson(e)).toList() as M;
  425. }
  426. if (<RewardsCategoryEntity>[] is M) {
  427. return data.map<RewardsCategoryEntity>((Map<String, dynamic> e) => RewardsCategoryEntity.fromJson(e)).toList() as M;
  428. }
  429. if (<RewardsDetailEntity>[] is M) {
  430. return data.map<RewardsDetailEntity>((Map<String, dynamic> e) => RewardsDetailEntity.fromJson(e)).toList() as M;
  431. }
  432. if (<RewardsDetailRedeemable>[] is M) {
  433. return data.map<RewardsDetailRedeemable>((Map<String, dynamic> e) => RewardsDetailRedeemable.fromJson(e)).toList() as M;
  434. }
  435. if (<RewardsHistoryEarnedEntity>[] is M) {
  436. return data.map<RewardsHistoryEarnedEntity>((Map<String, dynamic> e) => RewardsHistoryEarnedEntity.fromJson(e)).toList() as M;
  437. }
  438. if (<RewardsHistoryEarnedList>[] is M) {
  439. return data.map<RewardsHistoryEarnedList>((Map<String, dynamic> e) => RewardsHistoryEarnedList.fromJson(e)).toList() as M;
  440. }
  441. if (<RewardsHomeEntity>[] is M) {
  442. return data.map<RewardsHomeEntity>((Map<String, dynamic> e) => RewardsHomeEntity.fromJson(e)).toList() as M;
  443. }
  444. if (<RewardsHomeData>[] is M) {
  445. return data.map<RewardsHomeData>((Map<String, dynamic> e) => RewardsHomeData.fromJson(e)).toList() as M;
  446. }
  447. if (<RewardsHomeDataRewards>[] is M) {
  448. return data.map<RewardsHomeDataRewards>((Map<String, dynamic> e) => RewardsHomeDataRewards.fromJson(e)).toList() as M;
  449. }
  450. if (<RewardsHomeTesEntity>[] is M) {
  451. return data.map<RewardsHomeTesEntity>((Map<String, dynamic> e) => RewardsHomeTesEntity.fromJson(e)).toList() as M;
  452. }
  453. if (<RewardsHomeTesRewards>[] is M) {
  454. return data.map<RewardsHomeTesRewards>((Map<String, dynamic> e) => RewardsHomeTesRewards.fromJson(e)).toList() as M;
  455. }
  456. if (<RewardsHomeTestEntity>[] is M) {
  457. return data.map<RewardsHomeTestEntity>((Map<String, dynamic> e) => RewardsHomeTestEntity.fromJson(e)).toList() as M;
  458. }
  459. if (<RewardsHomeTxEntity>[] is M) {
  460. return data.map<RewardsHomeTxEntity>((Map<String, dynamic> e) => RewardsHomeTxEntity.fromJson(e)).toList() as M;
  461. }
  462. if (<RewardsIndexEntity>[] is M) {
  463. return data.map<RewardsIndexEntity>((Map<String, dynamic> e) => RewardsIndexEntity.fromJson(e)).toList() as M;
  464. }
  465. if (<RewardsIndexContinuous>[] is M) {
  466. return data.map<RewardsIndexContinuous>((Map<String, dynamic> e) => RewardsIndexContinuous.fromJson(e)).toList() as M;
  467. }
  468. if (<RewardsIndexTasks>[] is M) {
  469. return data.map<RewardsIndexTasks>((Map<String, dynamic> e) => RewardsIndexTasks.fromJson(e)).toList() as M;
  470. }
  471. if (<RewardsListEntity>[] is M) {
  472. return data.map<RewardsListEntity>((Map<String, dynamic> e) => RewardsListEntity.fromJson(e)).toList() as M;
  473. }
  474. if (<RewardsListList>[] is M) {
  475. return data.map<RewardsListList>((Map<String, dynamic> e) => RewardsListList.fromJson(e)).toList() as M;
  476. }
  477. if (<RewardsMyDetailEntity>[] is M) {
  478. return data.map<RewardsMyDetailEntity>((Map<String, dynamic> e) => RewardsMyDetailEntity.fromJson(e)).toList() as M;
  479. }
  480. if (<RewardsMyDetailAccount>[] is M) {
  481. return data.map<RewardsMyDetailAccount>((Map<String, dynamic> e) => RewardsMyDetailAccount.fromJson(e)).toList() as M;
  482. }
  483. if (<RewardsMyDetailReward>[] is M) {
  484. return data.map<RewardsMyDetailReward>((Map<String, dynamic> e) => RewardsMyDetailReward.fromJson(e)).toList() as M;
  485. }
  486. if (<RewardsMyEntity>[] is M) {
  487. return data.map<RewardsMyEntity>((Map<String, dynamic> e) => RewardsMyEntity.fromJson(e)).toList() as M;
  488. }
  489. if (<RewardsMyList>[] is M) {
  490. return data.map<RewardsMyList>((Map<String, dynamic> e) => RewardsMyList.fromJson(e)).toList() as M;
  491. }
  492. if (<RewardsMyListReward>[] is M) {
  493. return data.map<RewardsMyListReward>((Map<String, dynamic> e) => RewardsMyListReward.fromJson(e)).toList() as M;
  494. }
  495. if (<RewardsSearchEntity>[] is M) {
  496. return data.map<RewardsSearchEntity>((Map<String, dynamic> e) => RewardsSearchEntity.fromJson(e)).toList() as M;
  497. }
  498. if (<RewardsSearchRewards>[] is M) {
  499. return data.map<RewardsSearchRewards>((Map<String, dynamic> e) => RewardsSearchRewards.fromJson(e)).toList() as M;
  500. }
  501. if (<ServerTime>[] is M) {
  502. return data.map<ServerTime>((Map<String, dynamic> e) => ServerTime.fromJson(e)).toList() as M;
  503. }
  504. if (<TextKonEntity>[] is M) {
  505. return data.map<TextKonEntity>((Map<String, dynamic> e) => TextKonEntity.fromJson(e)).toList() as M;
  506. }
  507. if (<UserMeEntity>[] is M) {
  508. return data.map<UserMeEntity>((Map<String, dynamic> e) => UserMeEntity.fromJson(e)).toList() as M;
  509. }
  510. if (<UserMeHouseholds>[] is M) {
  511. return data.map<UserMeHouseholds>((Map<String, dynamic> e) => UserMeHouseholds.fromJson(e)).toList() as M;
  512. }
  513. if (<UserMeEstates>[] is M) {
  514. return data.map<UserMeEstates>((Map<String, dynamic> e) => UserMeEstates.fromJson(e)).toList() as M;
  515. }
  516. if (<UserMeEstatesAccounts>[] is M) {
  517. return data.map<UserMeEstatesAccounts>((Map<String, dynamic> e) => UserMeEstatesAccounts.fromJson(e)).toList() as M;
  518. }
  519. if (<UserMeEstatesAccountsUnit>[] is M) {
  520. return data.map<UserMeEstatesAccountsUnit>((Map<String, dynamic> e) => UserMeEstatesAccountsUnit.fromJson(e)).toList() as M;
  521. }
  522. if (<UserMeDefaultUnit>[] is M) {
  523. return data.map<UserMeDefaultUnit>((Map<String, dynamic> e) => UserMeDefaultUnit.fromJson(e)).toList() as M;
  524. }
  525. if (<UserMeInformation>[] is M) {
  526. return data.map<UserMeInformation>((Map<String, dynamic> e) => UserMeInformation.fromJson(e)).toList() as M;
  527. }
  528. if (<VisitorPageEntity>[] is M) {
  529. return data.map<VisitorPageEntity>((Map<String, dynamic> e) => VisitorPageEntity.fromJson(e)).toList() as M;
  530. }
  531. if (<VisitorPageList>[] is M) {
  532. return data.map<VisitorPageList>((Map<String, dynamic> e) => VisitorPageList.fromJson(e)).toList() as M;
  533. }
  534. debugPrint("$M not found");
  535. return null;
  536. }
  537. static M? fromJsonAsT<M>(dynamic json) {
  538. if (json is M) {
  539. return json;
  540. }
  541. if (json is List) {
  542. return _getListChildType<M>(json.map((dynamic e) => e as Map<String, dynamic>).toList());
  543. } else {
  544. return jsonConvert.convert<M>(json);
  545. }
  546. }
  547. }
  548. class JsonConvertClassCollection {
  549. Map<String, JsonConvertFunction> convertFuncMap = {
  550. (AuthLoginEntity).toString(): AuthLoginEntity.fromJson,
  551. (CaptchaImgEntity).toString(): CaptchaImgEntity.fromJson,
  552. (FacilityBookEntity).toString(): FacilityBookEntity.fromJson,
  553. (FacilityBookFacilityType).toString(): FacilityBookFacilityType.fromJson,
  554. (FacilityBookFacilities).toString(): FacilityBookFacilities.fromJson,
  555. (FacilityBookFacilitiesPeriods).toString(): FacilityBookFacilitiesPeriods.fromJson,
  556. (FacilityIndexEntity).toString(): FacilityIndexEntity.fromJson,
  557. (FacilityPageEntity).toString(): FacilityPageEntity.fromJson,
  558. (FacilityDetail).toString(): FacilityDetail.fromJson,
  559. (FacilityPageListBooking).toString(): FacilityPageListBooking.fromJson,
  560. (FacilityPageListFacility).toString(): FacilityPageListFacility.fromJson,
  561. (FacilityPageListFacilityType).toString(): FacilityPageListFacilityType.fromJson,
  562. (FacilityPageListTimePeriod).toString(): FacilityPageListTimePeriod.fromJson,
  563. (FacilityPageListAccount).toString(): FacilityPageListAccount.fromJson,
  564. (FeedbackDetailEntity).toString(): FeedbackDetailEntity.fromJson,
  565. (FeedbackDetailReplies).toString(): FeedbackDetailReplies.fromJson,
  566. (FeedbackListEntity).toString(): FeedbackListEntity.fromJson,
  567. (FeedbackItemEntity).toString(): FeedbackItemEntity.fromJson,
  568. (FormContentEntity).toString(): FormContentEntity.fromJson,
  569. (FormDetailEntity).toString(): FormDetailEntity.fromJson,
  570. (FormListEntity).toString(): FormListEntity.fromJson,
  571. (FormOptionEntity).toString(): FormOptionEntity.fromJson,
  572. (FormSubmittedEntity).toString(): FormSubmittedEntity.fromJson,
  573. (FormSubmittedEstateOnlineForm).toString(): FormSubmittedEstateOnlineForm.fromJson,
  574. (FormSubmittedPageEntity).toString(): FormSubmittedPageEntity.fromJson,
  575. (GarageSaleRentDetailEntity).toString(): GarageSaleRentDetailEntity.fromJson,
  576. (GarageSaleRentDetailAccount).toString(): GarageSaleRentDetailAccount.fromJson,
  577. (GarageSaleRentEntity).toString(): GarageSaleRentEntity.fromJson,
  578. (GarageSaleRentList).toString(): GarageSaleRentList.fromJson,
  579. (GarageSaleRentListAccount).toString(): GarageSaleRentListAccount.fromJson,
  580. (HomeListEntity).toString(): HomeListEntity.fromJson,
  581. (HomeListBanners).toString(): HomeListBanners.fromJson,
  582. (HomeListLatestTransactions).toString(): HomeListLatestTransactions.fromJson,
  583. (HomeListPropertyNews).toString(): HomeListPropertyNews.fromJson,
  584. (IdNameEntity).toString(): IdNameEntity.fromJson,
  585. (LatestNewsDetailEntity).toString(): LatestNewsDetailEntity.fromJson,
  586. (LatestNewsPageEntity).toString(): LatestNewsPageEntity.fromJson,
  587. (LatestNewsList).toString(): LatestNewsList.fromJson,
  588. (MyfollowingListEntity).toString(): MyfollowingListEntity.fromJson,
  589. (MypostsNewsfeedEntity).toString(): MypostsNewsfeedEntity.fromJson,
  590. (MypostsNewsfeedList).toString(): MypostsNewsfeedList.fromJson,
  591. (MypostsNewsfeedListAccount).toString(): MypostsNewsfeedListAccount.fromJson,
  592. (MypostsSaleRentEntity).toString(): MypostsSaleRentEntity.fromJson,
  593. (MypostsSaleRentList).toString(): MypostsSaleRentList.fromJson,
  594. (NewsfeedCommentPublishEntity).toString(): NewsfeedCommentPublishEntity.fromJson,
  595. (NewsfeedDetailEntity).toString(): NewsfeedDetailEntity.fromJson,
  596. (NewsfeedDetailAccount).toString(): NewsfeedDetailAccount.fromJson,
  597. (NewsfeedDetailComments).toString(): NewsfeedDetailComments.fromJson,
  598. (NewsfeedDetailCommentsAccount).toString(): NewsfeedDetailCommentsAccount.fromJson,
  599. (NewsfeedDetailCommentsToAccount).toString(): NewsfeedDetailCommentsToAccount.fromJson,
  600. (NewsfeedFollowingEntity).toString(): NewsfeedFollowingEntity.fromJson,
  601. (NewsfeedFollowingList).toString(): NewsfeedFollowingList.fromJson,
  602. (NewsfeedFollowingListAccount).toString(): NewsfeedFollowingListAccount.fromJson,
  603. (NewsfeedForyouEntity).toString(): NewsfeedForyouEntity.fromJson,
  604. (NewsfeedForyouList).toString(): NewsfeedForyouList.fromJson,
  605. (NewsfeedForyouListAccount).toString(): NewsfeedForyouListAccount.fromJson,
  606. (NewsfeedNewsEntity).toString(): NewsfeedNewsEntity.fromJson,
  607. (NewsfeedNewsList).toString(): NewsfeedNewsList.fromJson,
  608. (NewsfeedNewsListAccount).toString(): NewsfeedNewsListAccount.fromJson,
  609. (NoticeBoardAnnounDetailEntity).toString(): NoticeBoardAnnounDetailEntity.fromJson,
  610. (NoticeBoardAnnounEntity).toString(): NoticeBoardAnnounEntity.fromJson,
  611. (NoticeBoardAnnounList).toString(): NoticeBoardAnnounList.fromJson,
  612. (NoticeBoardDocumentsEntity).toString(): NoticeBoardDocumentsEntity.fromJson,
  613. (NoticeBoardDocumentsList).toString(): NoticeBoardDocumentsList.fromJson,
  614. (NoticeBoardEventDetailEntity).toString(): NoticeBoardEventDetailEntity.fromJson,
  615. (NoticeBoardEventEntity).toString(): NoticeBoardEventEntity.fromJson,
  616. (NoticeBoardEventList).toString(): NoticeBoardEventList.fromJson,
  617. (PaymentPageEntity).toString(): PaymentPageEntity.fromJson,
  618. (PaymentPageList).toString(): PaymentPageList.fromJson,
  619. (PropertyNewsDetailEntity).toString(): PropertyNewsDetailEntity.fromJson,
  620. (PropertyNewsEntity).toString(): PropertyNewsEntity.fromJson,
  621. (PropertyNewsList).toString(): PropertyNewsList.fromJson,
  622. (PropertySaleRentEntity).toString(): PropertySaleRentEntity.fromJson,
  623. (PropertySaleRentList).toString(): PropertySaleRentList.fromJson,
  624. (RewardsActiveDetailEntity).toString(): RewardsActiveDetailEntity.fromJson,
  625. (RewardsActiveDetailData).toString(): RewardsActiveDetailData.fromJson,
  626. (RewardsActiveDetailDataAccount).toString(): RewardsActiveDetailDataAccount.fromJson,
  627. (RewardsActiveDetailDataReward).toString(): RewardsActiveDetailDataReward.fromJson,
  628. (RewardsBuyEntity).toString(): RewardsBuyEntity.fromJson,
  629. (RewardsBuyReward).toString(): RewardsBuyReward.fromJson,
  630. (RewardsBuyRewardRedeemable).toString(): RewardsBuyRewardRedeemable.fromJson,
  631. (RewardsCategoryEntity).toString(): RewardsCategoryEntity.fromJson,
  632. (RewardsDetailEntity).toString(): RewardsDetailEntity.fromJson,
  633. (RewardsDetailRedeemable).toString(): RewardsDetailRedeemable.fromJson,
  634. (RewardsHistoryEarnedEntity).toString(): RewardsHistoryEarnedEntity.fromJson,
  635. (RewardsHistoryEarnedList).toString(): RewardsHistoryEarnedList.fromJson,
  636. (RewardsHomeEntity).toString(): RewardsHomeEntity.fromJson,
  637. (RewardsHomeData).toString(): RewardsHomeData.fromJson,
  638. (RewardsHomeDataRewards).toString(): RewardsHomeDataRewards.fromJson,
  639. (RewardsHomeTesEntity).toString(): RewardsHomeTesEntity.fromJson,
  640. (RewardsHomeTesRewards).toString(): RewardsHomeTesRewards.fromJson,
  641. (RewardsHomeTestEntity).toString(): RewardsHomeTestEntity.fromJson,
  642. (RewardsHomeTxEntity).toString(): RewardsHomeTxEntity.fromJson,
  643. (RewardsIndexEntity).toString(): RewardsIndexEntity.fromJson,
  644. (RewardsIndexContinuous).toString(): RewardsIndexContinuous.fromJson,
  645. (RewardsIndexTasks).toString(): RewardsIndexTasks.fromJson,
  646. (RewardsListEntity).toString(): RewardsListEntity.fromJson,
  647. (RewardsListList).toString(): RewardsListList.fromJson,
  648. (RewardsMyDetailEntity).toString(): RewardsMyDetailEntity.fromJson,
  649. (RewardsMyDetailAccount).toString(): RewardsMyDetailAccount.fromJson,
  650. (RewardsMyDetailReward).toString(): RewardsMyDetailReward.fromJson,
  651. (RewardsMyEntity).toString(): RewardsMyEntity.fromJson,
  652. (RewardsMyList).toString(): RewardsMyList.fromJson,
  653. (RewardsMyListReward).toString(): RewardsMyListReward.fromJson,
  654. (RewardsSearchEntity).toString(): RewardsSearchEntity.fromJson,
  655. (RewardsSearchRewards).toString(): RewardsSearchRewards.fromJson,
  656. (ServerTime).toString(): ServerTime.fromJson,
  657. (TextKonEntity).toString(): TextKonEntity.fromJson,
  658. (UserMeEntity).toString(): UserMeEntity.fromJson,
  659. (UserMeHouseholds).toString(): UserMeHouseholds.fromJson,
  660. (UserMeEstates).toString(): UserMeEstates.fromJson,
  661. (UserMeEstatesAccounts).toString(): UserMeEstatesAccounts.fromJson,
  662. (UserMeEstatesAccountsUnit).toString(): UserMeEstatesAccountsUnit.fromJson,
  663. (UserMeDefaultUnit).toString(): UserMeDefaultUnit.fromJson,
  664. (UserMeInformation).toString(): UserMeInformation.fromJson,
  665. (VisitorPageEntity).toString(): VisitorPageEntity.fromJson,
  666. (VisitorPageList).toString(): VisitorPageList.fromJson,
  667. };
  668. bool containsKey(String type) {
  669. return convertFuncMap.containsKey(type);
  670. }
  671. JsonConvertFunction? operator [](String key) {
  672. return convertFuncMap[key];
  673. }
  674. }