123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706 |
- // ignore_for_file: non_constant_identifier_names
- // ignore_for_file: camel_case_types
- // ignore_for_file: prefer_single_quotes
- // This file is automatically generated. DO NOT EDIT, all your changes would be lost.
- import 'package:flutter/material.dart' show debugPrint;
- import 'package:domain/entity/response/add_edit_revise_view_s_g_entity.dart';
- import 'package:domain/entity/response/attendance_entity.dart';
- import 'package:domain/entity/response/attendance_review_entity.dart';
- import 'package:domain/entity/response/check_success_entity.dart';
- import 'package:domain/entity/response/device_list_entity.dart';
- import 'package:domain/entity/response/fiance_report_entity.dart';
- import 'package:domain/entity/response/hotel_info_entity.dart';
- import 'package:domain/entity/response/id_name_entity.dart';
- import 'package:domain/entity/response/job_applied_edit_index_s_g_entity.dart';
- import 'package:domain/entity/response/job_applied_index_s_g_entity.dart';
- import 'package:domain/entity/response/job_applied_list_s_g_entity.dart';
- import 'package:domain/entity/response/job_applied_remark_view_s_g_entity.dart';
- import 'package:domain/entity/response/job_applied_staff_s_g_entity.dart';
- import 'package:domain/entity/response/job_list_add_staff_entity.dart';
- import 'package:domain/entity/response/job_list_applied_edit_entity.dart';
- import 'package:domain/entity/response/job_list_applied_info_entity.dart';
- import 'package:domain/entity/response/job_list_applied_staff_list_entity.dart';
- import 'package:domain/entity/response/job_list_applied_staff_search_entity.dart';
- import 'package:domain/entity/response/job_list_applied_work_flow_entity.dart';
- import 'package:domain/entity/response/job_list_detail_entity.dart';
- import 'package:domain/entity/response/job_list_edit_index_s_g_entity.dart';
- import 'package:domain/entity/response/job_list_entity.dart';
- import 'package:domain/entity/response/job_list_index_entity.dart';
- import 'package:domain/entity/response/job_list_index_s_g_entity.dart';
- import 'package:domain/entity/response/job_list_remark_view_entity.dart';
- import 'package:domain/entity/response/job_list_s_g_entity.dart';
- import 'package:domain/entity/response/job_template_edit_index_entity.dart';
- import 'package:domain/entity/response/job_template_s_g_entity.dart';
- import 'package:domain/entity/response/job_title_edit_index_entity.dart';
- import 'package:domain/entity/response/job_title_s_g_entity.dart';
- import 'package:domain/entity/response/labour_report_entity.dart';
- import 'package:domain/entity/response/labour_report_v_n_entity.dart';
- import 'package:domain/entity/response/labour_request_edit_index_entity.dart';
- import 'package:domain/entity/response/labour_request_index_entity.dart';
- import 'package:domain/entity/response/labour_request_list_entity.dart';
- import 'package:domain/entity/response/labour_request_s_g_add_index_entity.dart';
- import 'package:domain/entity/response/labour_request_s_g_edit_index_entity.dart';
- import 'package:domain/entity/response/labour_request_s_g_entity.dart';
- import 'package:domain/entity/response/labour_request_s_g_list_entity.dart';
- import 'package:domain/entity/response/labour_request_work_flow_entity.dart';
- import 'package:domain/entity/response/labour_review_list_entity.dart';
- import 'package:domain/entity/response/labour_review_status_entity.dart';
- import 'package:domain/entity/response/revise_index_s_g_entity.dart';
- import 'package:domain/entity/response/revise_list_s_g_entity.dart';
- import 'package:domain/entity/response/revise_log_s_g_entity.dart';
- import 'package:domain/entity/response/staff_detail_entity.dart';
- import 'package:domain/entity/response/staff_detail_s_g_entity.dart';
- import 'package:domain/entity/response/staff_job_history_s_g_entity.dart';
- import 'package:domain/entity/response/staff_labour_history_entity.dart';
- import 'package:domain/entity/response/staff_remark_history_entity.dart';
- import 'package:domain/entity/response/staff_report_v_n_entity.dart';
- import 'package:domain/entity/response/staff_request_report_entity.dart';
- import 'package:domain/entity/response/staff_review_history_s_g_entity.dart';
- import 'package:domain/entity/server_time.dart';
- JsonConvert jsonConvert = JsonConvert();
- typedef JsonConvertFunction<T> = T Function(Map<String, dynamic> json);
- typedef EnumConvertFunction<T> = T Function(String value);
- typedef ConvertExceptionHandler = void Function(Object error, StackTrace stackTrace);
- extension MapSafeExt<K, V> on Map<K, V> {
- T? getOrNull<T>(K? key) {
- if (!containsKey(key) || key == null) {
- return null;
- } else {
- return this[key] as T?;
- }
- }
- }
- class JsonConvert {
- static ConvertExceptionHandler? onError;
- JsonConvertClassCollection convertFuncMap = JsonConvertClassCollection();
- /// 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
- /// https://flutter.cn/docs/development/tools/hot-reload
- /// class MyApp extends StatelessWidget {
- /// const MyApp({Key? key})
- /// : super(key: key);
- ///
- /// @override
- /// Widget build(BuildContext context) {
- /// jsonConvert.reassembleConvertFuncMap();
- /// return MaterialApp();
- /// }
- /// }
- void reassembleConvertFuncMap() {
- bool isReleaseMode = const bool.fromEnvironment('dart.vm.product');
- if (!isReleaseMode) {
- convertFuncMap = JsonConvertClassCollection();
- }
- }
- T? convert<T>(dynamic value, {EnumConvertFunction? enumConvert}) {
- if (value == null) {
- return null;
- }
- if (value is T) {
- return value;
- }
- try {
- return _asT<T>(value, enumConvert: enumConvert);
- } catch (e, stackTrace) {
- debugPrint('asT<$T> $e $stackTrace');
- if (onError != null) {
- onError!(e, stackTrace);
- }
- return null;
- }
- }
- List<T?>? convertList<T>(List<dynamic>? value, {EnumConvertFunction? enumConvert}) {
- if (value == null) {
- return null;
- }
- try {
- return value.map((dynamic e) => _asT<T>(e, enumConvert: enumConvert)).toList();
- } catch (e, stackTrace) {
- debugPrint('asT<$T> $e $stackTrace');
- if (onError != null) {
- onError!(e, stackTrace);
- }
- return <T>[];
- }
- }
- List<T>? convertListNotNull<T>(dynamic value, {EnumConvertFunction? enumConvert}) {
- if (value == null) {
- return null;
- }
- try {
- return (value as List<dynamic>).map((dynamic e) => _asT<T>(e, enumConvert: enumConvert)!).toList();
- } catch (e, stackTrace) {
- debugPrint('asT<$T> $e $stackTrace');
- if (onError != null) {
- onError!(e, stackTrace);
- }
- return <T>[];
- }
- }
- T? _asT<T extends Object?>(dynamic value,
- {EnumConvertFunction? enumConvert}) {
- final String type = T.toString();
- final String valueS = value.toString();
- if (enumConvert != null) {
- return enumConvert(valueS) as T;
- } else if (type == "String") {
- return valueS as T;
- } else if (type == "int") {
- final int? intValue = int.tryParse(valueS);
- if (intValue == null) {
- return double.tryParse(valueS)?.toInt() as T?;
- } else {
- return intValue as T;
- }
- } else if (type == "double") {
- return double.parse(valueS) as T;
- } else if (type == "DateTime") {
- return DateTime.parse(valueS) as T;
- } else if (type == "bool") {
- if (valueS == '0' || valueS == '1') {
- return (valueS == '1') as T;
- }
- return (valueS == 'true') as T;
- } else if (type == "Map" || type.startsWith("Map<")) {
- return value as T;
- } else {
- if (convertFuncMap.containsKey(type)) {
- if (value == null) {
- return null;
- }
- var covertFunc = convertFuncMap[type]!;
- if (covertFunc is Map<String, dynamic>) {
- return covertFunc(value as Map<String, dynamic>) as T;
- } else {
- return covertFunc(Map<String, dynamic>.from(value)) as T;
- }
- } else {
- throw UnimplementedError('$type unimplemented,you can try running the app again');
- }
- }
- }
- //list is returned by type
- static M? _getListChildType<M>(List<Map<String, dynamic>> data) {
- if (<AddEditReviseViewSGEntity>[] is M) {
- return data.map<AddEditReviseViewSGEntity>((Map<String, dynamic> e) => AddEditReviseViewSGEntity.fromJson(e)).toList() as M;
- }
- if (<AttendanceEntity>[] is M) {
- return data.map<AttendanceEntity>((Map<String, dynamic> e) => AttendanceEntity.fromJson(e)).toList() as M;
- }
- if (<AttendanceList>[] is M) {
- return data.map<AttendanceList>((Map<String, dynamic> e) => AttendanceList.fromJson(e)).toList() as M;
- }
- if (<AttendanceReviewEntity>[] is M) {
- return data.map<AttendanceReviewEntity>((Map<String, dynamic> e) => AttendanceReviewEntity.fromJson(e)).toList() as M;
- }
- if (<AttendanceReviewRows>[] is M) {
- return data.map<AttendanceReviewRows>((Map<String, dynamic> e) => AttendanceReviewRows.fromJson(e)).toList() as M;
- }
- if (<CheckSuccessEntity>[] is M) {
- return data.map<CheckSuccessEntity>((Map<String, dynamic> e) => CheckSuccessEntity.fromJson(e)).toList() as M;
- }
- if (<DeviceListEntity>[] is M) {
- return data.map<DeviceListEntity>((Map<String, dynamic> e) => DeviceListEntity.fromJson(e)).toList() as M;
- }
- if (<DeviceListRows>[] is M) {
- return data.map<DeviceListRows>((Map<String, dynamic> e) => DeviceListRows.fromJson(e)).toList() as M;
- }
- if (<FianceReportEntity>[] is M) {
- return data.map<FianceReportEntity>((Map<String, dynamic> e) => FianceReportEntity.fromJson(e)).toList() as M;
- }
- if (<FianceReportRateList>[] is M) {
- return data.map<FianceReportRateList>((Map<String, dynamic> e) => FianceReportRateList.fromJson(e)).toList() as M;
- }
- if (<HotelInfoEntity>[] is M) {
- return data.map<HotelInfoEntity>((Map<String, dynamic> e) => HotelInfoEntity.fromJson(e)).toList() as M;
- }
- if (<HotelInfoMenus>[] is M) {
- return data.map<HotelInfoMenus>((Map<String, dynamic> e) => HotelInfoMenus.fromJson(e)).toList() as M;
- }
- if (<HotelInfoMenusChildren>[] is M) {
- return data.map<HotelInfoMenusChildren>((Map<String, dynamic> e) => HotelInfoMenusChildren.fromJson(e)).toList() as M;
- }
- if (<IdNameEntity>[] is M) {
- return data.map<IdNameEntity>((Map<String, dynamic> e) => IdNameEntity.fromJson(e)).toList() as M;
- }
- if (<JobAppliedEditIndexSGEntity>[] is M) {
- return data.map<JobAppliedEditIndexSGEntity>((Map<String, dynamic> e) => JobAppliedEditIndexSGEntity.fromJson(e)).toList() as M;
- }
- if (<JobAppliedEditIndexSGStatusList>[] is M) {
- return data.map<JobAppliedEditIndexSGStatusList>((Map<String, dynamic> e) => JobAppliedEditIndexSGStatusList.fromJson(e)).toList() as M;
- }
- if (<JobAppliedIndexSGEntity>[] is M) {
- return data.map<JobAppliedIndexSGEntity>((Map<String, dynamic> e) => JobAppliedIndexSGEntity.fromJson(e)).toList() as M;
- }
- if (<JobAppliedIndexSGStatusList>[] is M) {
- return data.map<JobAppliedIndexSGStatusList>((Map<String, dynamic> e) => JobAppliedIndexSGStatusList.fromJson(e)).toList() as M;
- }
- if (<JobAppliedListSGEntity>[] is M) {
- return data.map<JobAppliedListSGEntity>((Map<String, dynamic> e) => JobAppliedListSGEntity.fromJson(e)).toList() as M;
- }
- if (<JobAppliedListSGRows>[] is M) {
- return data.map<JobAppliedListSGRows>((Map<String, dynamic> e) => JobAppliedListSGRows.fromJson(e)).toList() as M;
- }
- if (<JobAppliedListSGRowsCheck>[] is M) {
- return data.map<JobAppliedListSGRowsCheck>((Map<String, dynamic> e) => JobAppliedListSGRowsCheck.fromJson(e)).toList() as M;
- }
- if (<JobAppliedListSGRowsStatusList>[] is M) {
- return data.map<JobAppliedListSGRowsStatusList>((Map<String, dynamic> e) => JobAppliedListSGRowsStatusList.fromJson(e)).toList() as M;
- }
- if (<JobAppliedRemarkViewSGEntity>[] is M) {
- return data.map<JobAppliedRemarkViewSGEntity>((Map<String, dynamic> e) => JobAppliedRemarkViewSGEntity.fromJson(e)).toList() as M;
- }
- if (<JobAppliedStaffSGEntity>[] is M) {
- return data.map<JobAppliedStaffSGEntity>((Map<String, dynamic> e) => JobAppliedStaffSGEntity.fromJson(e)).toList() as M;
- }
- if (<JobAppliedStaffSGRows>[] is M) {
- return data.map<JobAppliedStaffSGRows>((Map<String, dynamic> e) => JobAppliedStaffSGRows.fromJson(e)).toList() as M;
- }
- if (<JobListAddStaffEntity>[] is M) {
- return data.map<JobListAddStaffEntity>((Map<String, dynamic> e) => JobListAddStaffEntity.fromJson(e)).toList() as M;
- }
- if (<JobListAddStaffResultList>[] is M) {
- return data.map<JobListAddStaffResultList>((Map<String, dynamic> e) => JobListAddStaffResultList.fromJson(e)).toList() as M;
- }
- if (<JobListAppliedEditEntity>[] is M) {
- return data.map<JobListAppliedEditEntity>((Map<String, dynamic> e) => JobListAppliedEditEntity.fromJson(e)).toList() as M;
- }
- if (<JobListAppliedEditReasonList>[] is M) {
- return data.map<JobListAppliedEditReasonList>((Map<String, dynamic> e) => JobListAppliedEditReasonList.fromJson(e)).toList() as M;
- }
- if (<JobListAppliedInfoEntity>[] is M) {
- return data.map<JobListAppliedInfoEntity>((Map<String, dynamic> e) => JobListAppliedInfoEntity.fromJson(e)).toList() as M;
- }
- if (<JobListAppliedStaffListEntity>[] is M) {
- return data.map<JobListAppliedStaffListEntity>((Map<String, dynamic> e) => JobListAppliedStaffListEntity.fromJson(e)).toList() as M;
- }
- if (<JobListAppliedStaffListRows>[] is M) {
- return data.map<JobListAppliedStaffListRows>((Map<String, dynamic> e) => JobListAppliedStaffListRows.fromJson(e)).toList() as M;
- }
- if (<JobListAppliedStaffListRowsSecurityIn>[] is M) {
- return data.map<JobListAppliedStaffListRowsSecurityIn>((Map<String, dynamic> e) => JobListAppliedStaffListRowsSecurityIn.fromJson(e)).toList() as M;
- }
- if (<JobListAppliedStaffListRowsSecurityOut>[] is M) {
- return data.map<JobListAppliedStaffListRowsSecurityOut>((Map<String, dynamic> e) => JobListAppliedStaffListRowsSecurityOut.fromJson(e)).toList() as M;
- }
- if (<JobListAppliedStaffListRowsWorkIn>[] is M) {
- return data.map<JobListAppliedStaffListRowsWorkIn>((Map<String, dynamic> e) => JobListAppliedStaffListRowsWorkIn.fromJson(e)).toList() as M;
- }
- if (<JobListAppliedStaffListRowsWorkOut>[] is M) {
- return data.map<JobListAppliedStaffListRowsWorkOut>((Map<String, dynamic> e) => JobListAppliedStaffListRowsWorkOut.fromJson(e)).toList() as M;
- }
- if (<JobListAppliedStaffSearchEntity>[] is M) {
- return data.map<JobListAppliedStaffSearchEntity>((Map<String, dynamic> e) => JobListAppliedStaffSearchEntity.fromJson(e)).toList() as M;
- }
- if (<JobListAppliedStaffSearchRows>[] is M) {
- return data.map<JobListAppliedStaffSearchRows>((Map<String, dynamic> e) => JobListAppliedStaffSearchRows.fromJson(e)).toList() as M;
- }
- if (<JobListAppliedWorkFlowEntity>[] is M) {
- return data.map<JobListAppliedWorkFlowEntity>((Map<String, dynamic> e) => JobListAppliedWorkFlowEntity.fromJson(e)).toList() as M;
- }
- if (<JobListAppliedWorkFlowRecords>[] is M) {
- return data.map<JobListAppliedWorkFlowRecords>((Map<String, dynamic> e) => JobListAppliedWorkFlowRecords.fromJson(e)).toList() as M;
- }
- if (<JobListDetailEntity>[] is M) {
- return data.map<JobListDetailEntity>((Map<String, dynamic> e) => JobListDetailEntity.fromJson(e)).toList() as M;
- }
- if (<JobListDetailDepartmentList>[] is M) {
- return data.map<JobListDetailDepartmentList>((Map<String, dynamic> e) => JobListDetailDepartmentList.fromJson(e)).toList() as M;
- }
- if (<JobListEditIndexSGEntity>[] is M) {
- return data.map<JobListEditIndexSGEntity>((Map<String, dynamic> e) => JobListEditIndexSGEntity.fromJson(e)).toList() as M;
- }
- if (<JobListEditIndexOption>[] is M) {
- return data.map<JobListEditIndexOption>((Map<String, dynamic> e) => JobListEditIndexOption.fromJson(e)).toList() as M;
- }
- if (<JobListEntity>[] is M) {
- return data.map<JobListEntity>((Map<String, dynamic> e) => JobListEntity.fromJson(e)).toList() as M;
- }
- if (<JobListRows>[] is M) {
- return data.map<JobListRows>((Map<String, dynamic> e) => JobListRows.fromJson(e)).toList() as M;
- }
- if (<JobListIndexEntity>[] is M) {
- return data.map<JobListIndexEntity>((Map<String, dynamic> e) => JobListIndexEntity.fromJson(e)).toList() as M;
- }
- if (<JobListIndexDepartmentList>[] is M) {
- return data.map<JobListIndexDepartmentList>((Map<String, dynamic> e) => JobListIndexDepartmentList.fromJson(e)).toList() as M;
- }
- if (<JobListIndexStatusList>[] is M) {
- return data.map<JobListIndexStatusList>((Map<String, dynamic> e) => JobListIndexStatusList.fromJson(e)).toList() as M;
- }
- if (<JobListIndexSGEntity>[] is M) {
- return data.map<JobListIndexSGEntity>((Map<String, dynamic> e) => JobListIndexSGEntity.fromJson(e)).toList() as M;
- }
- if (<JobListIndexSGOption>[] is M) {
- return data.map<JobListIndexSGOption>((Map<String, dynamic> e) => JobListIndexSGOption.fromJson(e)).toList() as M;
- }
- if (<JobListRemarkViewEntity>[] is M) {
- return data.map<JobListRemarkViewEntity>((Map<String, dynamic> e) => JobListRemarkViewEntity.fromJson(e)).toList() as M;
- }
- if (<JobListSGEntity>[] is M) {
- return data.map<JobListSGEntity>((Map<String, dynamic> e) => JobListSGEntity.fromJson(e)).toList() as M;
- }
- if (<JobListSGRows>[] is M) {
- return data.map<JobListSGRows>((Map<String, dynamic> e) => JobListSGRows.fromJson(e)).toList() as M;
- }
- if (<JobTemplateEditIndexEntity>[] is M) {
- return data.map<JobTemplateEditIndexEntity>((Map<String, dynamic> e) => JobTemplateEditIndexEntity.fromJson(e)).toList() as M;
- }
- if (<JobTemplateEditIndexAgeList>[] is M) {
- return data.map<JobTemplateEditIndexAgeList>((Map<String, dynamic> e) => JobTemplateEditIndexAgeList.fromJson(e)).toList() as M;
- }
- if (<JobTemplateEditIndexSexList>[] is M) {
- return data.map<JobTemplateEditIndexSexList>((Map<String, dynamic> e) => JobTemplateEditIndexSexList.fromJson(e)).toList() as M;
- }
- if (<JobTemplateEditIndexLanguageList>[] is M) {
- return data.map<JobTemplateEditIndexLanguageList>((Map<String, dynamic> e) => JobTemplateEditIndexLanguageList.fromJson(e)).toList() as M;
- }
- if (<JobTemplateSGEntity>[] is M) {
- return data.map<JobTemplateSGEntity>((Map<String, dynamic> e) => JobTemplateSGEntity.fromJson(e)).toList() as M;
- }
- if (<JobTemplateSGRows>[] is M) {
- return data.map<JobTemplateSGRows>((Map<String, dynamic> e) => JobTemplateSGRows.fromJson(e)).toList() as M;
- }
- if (<JobTitleEditIndexEntity>[] is M) {
- return data.map<JobTitleEditIndexEntity>((Map<String, dynamic> e) => JobTitleEditIndexEntity.fromJson(e)).toList() as M;
- }
- if (<JobTitleEditIndexTemplate>[] is M) {
- return data.map<JobTitleEditIndexTemplate>((Map<String, dynamic> e) => JobTitleEditIndexTemplate.fromJson(e)).toList() as M;
- }
- if (<JobTitleSGEntity>[] is M) {
- return data.map<JobTitleSGEntity>((Map<String, dynamic> e) => JobTitleSGEntity.fromJson(e)).toList() as M;
- }
- if (<JobTitleSGRows>[] is M) {
- return data.map<JobTitleSGRows>((Map<String, dynamic> e) => JobTitleSGRows.fromJson(e)).toList() as M;
- }
- if (<LabourReportEntity>[] is M) {
- return data.map<LabourReportEntity>((Map<String, dynamic> e) => LabourReportEntity.fromJson(e)).toList() as M;
- }
- if (<LabourReportRows>[] is M) {
- return data.map<LabourReportRows>((Map<String, dynamic> e) => LabourReportRows.fromJson(e)).toList() as M;
- }
- if (<LabourReportTotal>[] is M) {
- return data.map<LabourReportTotal>((Map<String, dynamic> e) => LabourReportTotal.fromJson(e)).toList() as M;
- }
- if (<LabourReportVNEntity>[] is M) {
- return data.map<LabourReportVNEntity>((Map<String, dynamic> e) => LabourReportVNEntity.fromJson(e)).toList() as M;
- }
- if (<LabourReportVNRows>[] is M) {
- return data.map<LabourReportVNRows>((Map<String, dynamic> e) => LabourReportVNRows.fromJson(e)).toList() as M;
- }
- if (<LabourReportVNTotal>[] is M) {
- return data.map<LabourReportVNTotal>((Map<String, dynamic> e) => LabourReportVNTotal.fromJson(e)).toList() as M;
- }
- if (<LabourRequestEditIndexEntity>[] is M) {
- return data.map<LabourRequestEditIndexEntity>((Map<String, dynamic> e) => LabourRequestEditIndexEntity.fromJson(e)).toList() as M;
- }
- if (<LabourRequestEditIndexTemplateList>[] is M) {
- return data.map<LabourRequestEditIndexTemplateList>((Map<String, dynamic> e) => LabourRequestEditIndexTemplateList.fromJson(e)).toList() as M;
- }
- if (<LabourRequestEditIndexDepartmentList>[] is M) {
- return data.map<LabourRequestEditIndexDepartmentList>((Map<String, dynamic> e) => LabourRequestEditIndexDepartmentList.fromJson(e)).toList() as M;
- }
- if (<LabourRequestIndexEntity>[] is M) {
- return data.map<LabourRequestIndexEntity>((Map<String, dynamic> e) => LabourRequestIndexEntity.fromJson(e)).toList() as M;
- }
- if (<LabourRequestIndexDepartmentList>[] is M) {
- return data.map<LabourRequestIndexDepartmentList>((Map<String, dynamic> e) => LabourRequestIndexDepartmentList.fromJson(e)).toList() as M;
- }
- if (<LabourRequestIndexStatusList>[] is M) {
- return data.map<LabourRequestIndexStatusList>((Map<String, dynamic> e) => LabourRequestIndexStatusList.fromJson(e)).toList() as M;
- }
- if (<LabourRequestListEntity>[] is M) {
- return data.map<LabourRequestListEntity>((Map<String, dynamic> e) => LabourRequestListEntity.fromJson(e)).toList() as M;
- }
- if (<LabourRequestListRows>[] is M) {
- return data.map<LabourRequestListRows>((Map<String, dynamic> e) => LabourRequestListRows.fromJson(e)).toList() as M;
- }
- if (<LabourRequestSGAddIndexEntity>[] is M) {
- return data.map<LabourRequestSGAddIndexEntity>((Map<String, dynamic> e) => LabourRequestSGAddIndexEntity.fromJson(e)).toList() as M;
- }
- if (<LabourRequestSGAddIndexOption>[] is M) {
- return data.map<LabourRequestSGAddIndexOption>((Map<String, dynamic> e) => LabourRequestSGAddIndexOption.fromJson(e)).toList() as M;
- }
- if (<LabourRequestSGEditIndexEntity>[] is M) {
- return data.map<LabourRequestSGEditIndexEntity>((Map<String, dynamic> e) => LabourRequestSGEditIndexEntity.fromJson(e)).toList() as M;
- }
- if (<LabourRequestSGEditIndexJob>[] is M) {
- return data.map<LabourRequestSGEditIndexJob>((Map<String, dynamic> e) => LabourRequestSGEditIndexJob.fromJson(e)).toList() as M;
- }
- if (<LabourRequestSGEditSelected>[] is M) {
- return data.map<LabourRequestSGEditSelected>((Map<String, dynamic> e) => LabourRequestSGEditSelected.fromJson(e)).toList() as M;
- }
- if (<LabourRequestSGEditIndexChecked>[] is M) {
- return data.map<LabourRequestSGEditIndexChecked>((Map<String, dynamic> e) => LabourRequestSGEditIndexChecked.fromJson(e)).toList() as M;
- }
- if (<LabourRequestSGEntity>[] is M) {
- return data.map<LabourRequestSGEntity>((Map<String, dynamic> e) => LabourRequestSGEntity.fromJson(e)).toList() as M;
- }
- if (<LabourRequestSGCountList>[] is M) {
- return data.map<LabourRequestSGCountList>((Map<String, dynamic> e) => LabourRequestSGCountList.fromJson(e)).toList() as M;
- }
- if (<LabourRequestSGListEntity>[] is M) {
- return data.map<LabourRequestSGListEntity>((Map<String, dynamic> e) => LabourRequestSGListEntity.fromJson(e)).toList() as M;
- }
- if (<LabourRequestSGListRows>[] is M) {
- return data.map<LabourRequestSGListRows>((Map<String, dynamic> e) => LabourRequestSGListRows.fromJson(e)).toList() as M;
- }
- if (<LabourRequestWorkFlowEntity>[] is M) {
- return data.map<LabourRequestWorkFlowEntity>((Map<String, dynamic> e) => LabourRequestWorkFlowEntity.fromJson(e)).toList() as M;
- }
- if (<LabourRequestWorkFlowRecords>[] is M) {
- return data.map<LabourRequestWorkFlowRecords>((Map<String, dynamic> e) => LabourRequestWorkFlowRecords.fromJson(e)).toList() as M;
- }
- if (<LabourReviewListEntity>[] is M) {
- return data.map<LabourReviewListEntity>((Map<String, dynamic> e) => LabourReviewListEntity.fromJson(e)).toList() as M;
- }
- if (<LabourReviewListRows>[] is M) {
- return data.map<LabourReviewListRows>((Map<String, dynamic> e) => LabourReviewListRows.fromJson(e)).toList() as M;
- }
- if (<LabourReviewStatusEntity>[] is M) {
- return data.map<LabourReviewStatusEntity>((Map<String, dynamic> e) => LabourReviewStatusEntity.fromJson(e)).toList() as M;
- }
- if (<LabourReviewStatusRecords>[] is M) {
- return data.map<LabourReviewStatusRecords>((Map<String, dynamic> e) => LabourReviewStatusRecords.fromJson(e)).toList() as M;
- }
- if (<ReviseIndexSGEntity>[] is M) {
- return data.map<ReviseIndexSGEntity>((Map<String, dynamic> e) => ReviseIndexSGEntity.fromJson(e)).toList() as M;
- }
- if (<ReviseIndexSGStatusList>[] is M) {
- return data.map<ReviseIndexSGStatusList>((Map<String, dynamic> e) => ReviseIndexSGStatusList.fromJson(e)).toList() as M;
- }
- if (<ReviseListSGEntity>[] is M) {
- return data.map<ReviseListSGEntity>((Map<String, dynamic> e) => ReviseListSGEntity.fromJson(e)).toList() as M;
- }
- if (<ReviseListSGRows>[] is M) {
- return data.map<ReviseListSGRows>((Map<String, dynamic> e) => ReviseListSGRows.fromJson(e)).toList() as M;
- }
- if (<ReviseLogSGEntity>[] is M) {
- return data.map<ReviseLogSGEntity>((Map<String, dynamic> e) => ReviseLogSGEntity.fromJson(e)).toList() as M;
- }
- if (<ReviseLogSGRecords>[] is M) {
- return data.map<ReviseLogSGRecords>((Map<String, dynamic> e) => ReviseLogSGRecords.fromJson(e)).toList() as M;
- }
- if (<ReviseLogSGRecordsContent>[] is M) {
- return data.map<ReviseLogSGRecordsContent>((Map<String, dynamic> e) => ReviseLogSGRecordsContent.fromJson(e)).toList() as M;
- }
- if (<ReviseLogSGRecordsOption>[] is M) {
- return data.map<ReviseLogSGRecordsOption>((Map<String, dynamic> e) => ReviseLogSGRecordsOption.fromJson(e)).toList() as M;
- }
- if (<StaffDetailEntity>[] is M) {
- return data.map<StaffDetailEntity>((Map<String, dynamic> e) => StaffDetailEntity.fromJson(e)).toList() as M;
- }
- if (<StaffDetailSGEntity>[] is M) {
- return data.map<StaffDetailSGEntity>((Map<String, dynamic> e) => StaffDetailSGEntity.fromJson(e)).toList() as M;
- }
- if (<StaffDetailSGReviews>[] is M) {
- return data.map<StaffDetailSGReviews>((Map<String, dynamic> e) => StaffDetailSGReviews.fromJson(e)).toList() as M;
- }
- if (<StaffDetailSGReviewsReviews>[] is M) {
- return data.map<StaffDetailSGReviewsReviews>((Map<String, dynamic> e) => StaffDetailSGReviewsReviews.fromJson(e)).toList() as M;
- }
- if (<StaffJobHistorySGEntity>[] is M) {
- return data.map<StaffJobHistorySGEntity>((Map<String, dynamic> e) => StaffJobHistorySGEntity.fromJson(e)).toList() as M;
- }
- if (<StaffJobHistorySGRows>[] is M) {
- return data.map<StaffJobHistorySGRows>((Map<String, dynamic> e) => StaffJobHistorySGRows.fromJson(e)).toList() as M;
- }
- if (<StaffLabourHistoryEntity>[] is M) {
- return data.map<StaffLabourHistoryEntity>((Map<String, dynamic> e) => StaffLabourHistoryEntity.fromJson(e)).toList() as M;
- }
- if (<StaffLabourHistoryRows>[] is M) {
- return data.map<StaffLabourHistoryRows>((Map<String, dynamic> e) => StaffLabourHistoryRows.fromJson(e)).toList() as M;
- }
- if (<StaffLabourHistoryRowsSecurityIn>[] is M) {
- return data.map<StaffLabourHistoryRowsSecurityIn>((Map<String, dynamic> e) => StaffLabourHistoryRowsSecurityIn.fromJson(e)).toList() as M;
- }
- if (<StaffLabourHistoryRowsSecurityOut>[] is M) {
- return data.map<StaffLabourHistoryRowsSecurityOut>((Map<String, dynamic> e) => StaffLabourHistoryRowsSecurityOut.fromJson(e)).toList() as M;
- }
- if (<StaffLabourHistoryRowsWorkIn>[] is M) {
- return data.map<StaffLabourHistoryRowsWorkIn>((Map<String, dynamic> e) => StaffLabourHistoryRowsWorkIn.fromJson(e)).toList() as M;
- }
- if (<StaffLabourHistoryRowsWorkOut>[] is M) {
- return data.map<StaffLabourHistoryRowsWorkOut>((Map<String, dynamic> e) => StaffLabourHistoryRowsWorkOut.fromJson(e)).toList() as M;
- }
- if (<StaffRemarkHistoryEntity>[] is M) {
- return data.map<StaffRemarkHistoryEntity>((Map<String, dynamic> e) => StaffRemarkHistoryEntity.fromJson(e)).toList() as M;
- }
- if (<StaffRemarkHistoryRows>[] is M) {
- return data.map<StaffRemarkHistoryRows>((Map<String, dynamic> e) => StaffRemarkHistoryRows.fromJson(e)).toList() as M;
- }
- if (<StaffReportVNEntity>[] is M) {
- return data.map<StaffReportVNEntity>((Map<String, dynamic> e) => StaffReportVNEntity.fromJson(e)).toList() as M;
- }
- if (<StaffRequestReportEntity>[] is M) {
- return data.map<StaffRequestReportEntity>((Map<String, dynamic> e) => StaffRequestReportEntity.fromJson(e)).toList() as M;
- }
- if (<StaffReviewHistorySGEntity>[] is M) {
- return data.map<StaffReviewHistorySGEntity>((Map<String, dynamic> e) => StaffReviewHistorySGEntity.fromJson(e)).toList() as M;
- }
- if (<StaffReviewHistorySGReviews>[] is M) {
- return data.map<StaffReviewHistorySGReviews>((Map<String, dynamic> e) => StaffReviewHistorySGReviews.fromJson(e)).toList() as M;
- }
- if (<ServerTime>[] is M) {
- return data.map<ServerTime>((Map<String, dynamic> e) => ServerTime.fromJson(e)).toList() as M;
- }
- debugPrint("$M not found");
- return null;
- }
- static M? fromJsonAsT<M>(dynamic json) {
- if (json is M) {
- return json;
- }
- if (json is List) {
- return _getListChildType<M>(json.map((dynamic e) => e as Map<String, dynamic>).toList());
- } else {
- return jsonConvert.convert<M>(json);
- }
- }
- }
- class JsonConvertClassCollection {
- Map<String, JsonConvertFunction> convertFuncMap = {
- (AddEditReviseViewSGEntity).toString(): AddEditReviseViewSGEntity.fromJson,
- (AttendanceEntity).toString(): AttendanceEntity.fromJson,
- (AttendanceList).toString(): AttendanceList.fromJson,
- (AttendanceReviewEntity).toString(): AttendanceReviewEntity.fromJson,
- (AttendanceReviewRows).toString(): AttendanceReviewRows.fromJson,
- (CheckSuccessEntity).toString(): CheckSuccessEntity.fromJson,
- (DeviceListEntity).toString(): DeviceListEntity.fromJson,
- (DeviceListRows).toString(): DeviceListRows.fromJson,
- (FianceReportEntity).toString(): FianceReportEntity.fromJson,
- (FianceReportRateList).toString(): FianceReportRateList.fromJson,
- (HotelInfoEntity).toString(): HotelInfoEntity.fromJson,
- (HotelInfoMenus).toString(): HotelInfoMenus.fromJson,
- (HotelInfoMenusChildren).toString(): HotelInfoMenusChildren.fromJson,
- (IdNameEntity).toString(): IdNameEntity.fromJson,
- (JobAppliedEditIndexSGEntity).toString(): JobAppliedEditIndexSGEntity.fromJson,
- (JobAppliedEditIndexSGStatusList).toString(): JobAppliedEditIndexSGStatusList.fromJson,
- (JobAppliedIndexSGEntity).toString(): JobAppliedIndexSGEntity.fromJson,
- (JobAppliedIndexSGStatusList).toString(): JobAppliedIndexSGStatusList.fromJson,
- (JobAppliedListSGEntity).toString(): JobAppliedListSGEntity.fromJson,
- (JobAppliedListSGRows).toString(): JobAppliedListSGRows.fromJson,
- (JobAppliedListSGRowsCheck).toString(): JobAppliedListSGRowsCheck.fromJson,
- (JobAppliedListSGRowsStatusList).toString(): JobAppliedListSGRowsStatusList.fromJson,
- (JobAppliedRemarkViewSGEntity).toString(): JobAppliedRemarkViewSGEntity.fromJson,
- (JobAppliedStaffSGEntity).toString(): JobAppliedStaffSGEntity.fromJson,
- (JobAppliedStaffSGRows).toString(): JobAppliedStaffSGRows.fromJson,
- (JobListAddStaffEntity).toString(): JobListAddStaffEntity.fromJson,
- (JobListAddStaffResultList).toString(): JobListAddStaffResultList.fromJson,
- (JobListAppliedEditEntity).toString(): JobListAppliedEditEntity.fromJson,
- (JobListAppliedEditReasonList).toString(): JobListAppliedEditReasonList.fromJson,
- (JobListAppliedInfoEntity).toString(): JobListAppliedInfoEntity.fromJson,
- (JobListAppliedStaffListEntity).toString(): JobListAppliedStaffListEntity.fromJson,
- (JobListAppliedStaffListRows).toString(): JobListAppliedStaffListRows.fromJson,
- (JobListAppliedStaffListRowsSecurityIn).toString(): JobListAppliedStaffListRowsSecurityIn.fromJson,
- (JobListAppliedStaffListRowsSecurityOut).toString(): JobListAppliedStaffListRowsSecurityOut.fromJson,
- (JobListAppliedStaffListRowsWorkIn).toString(): JobListAppliedStaffListRowsWorkIn.fromJson,
- (JobListAppliedStaffListRowsWorkOut).toString(): JobListAppliedStaffListRowsWorkOut.fromJson,
- (JobListAppliedStaffSearchEntity).toString(): JobListAppliedStaffSearchEntity.fromJson,
- (JobListAppliedStaffSearchRows).toString(): JobListAppliedStaffSearchRows.fromJson,
- (JobListAppliedWorkFlowEntity).toString(): JobListAppliedWorkFlowEntity.fromJson,
- (JobListAppliedWorkFlowRecords).toString(): JobListAppliedWorkFlowRecords.fromJson,
- (JobListDetailEntity).toString(): JobListDetailEntity.fromJson,
- (JobListDetailDepartmentList).toString(): JobListDetailDepartmentList.fromJson,
- (JobListEditIndexSGEntity).toString(): JobListEditIndexSGEntity.fromJson,
- (JobListEditIndexOption).toString(): JobListEditIndexOption.fromJson,
- (JobListEntity).toString(): JobListEntity.fromJson,
- (JobListRows).toString(): JobListRows.fromJson,
- (JobListIndexEntity).toString(): JobListIndexEntity.fromJson,
- (JobListIndexDepartmentList).toString(): JobListIndexDepartmentList.fromJson,
- (JobListIndexStatusList).toString(): JobListIndexStatusList.fromJson,
- (JobListIndexSGEntity).toString(): JobListIndexSGEntity.fromJson,
- (JobListIndexSGOption).toString(): JobListIndexSGOption.fromJson,
- (JobListRemarkViewEntity).toString(): JobListRemarkViewEntity.fromJson,
- (JobListSGEntity).toString(): JobListSGEntity.fromJson,
- (JobListSGRows).toString(): JobListSGRows.fromJson,
- (JobTemplateEditIndexEntity).toString(): JobTemplateEditIndexEntity.fromJson,
- (JobTemplateEditIndexAgeList).toString(): JobTemplateEditIndexAgeList.fromJson,
- (JobTemplateEditIndexSexList).toString(): JobTemplateEditIndexSexList.fromJson,
- (JobTemplateEditIndexLanguageList).toString(): JobTemplateEditIndexLanguageList.fromJson,
- (JobTemplateSGEntity).toString(): JobTemplateSGEntity.fromJson,
- (JobTemplateSGRows).toString(): JobTemplateSGRows.fromJson,
- (JobTitleEditIndexEntity).toString(): JobTitleEditIndexEntity.fromJson,
- (JobTitleEditIndexTemplate).toString(): JobTitleEditIndexTemplate.fromJson,
- (JobTitleSGEntity).toString(): JobTitleSGEntity.fromJson,
- (JobTitleSGRows).toString(): JobTitleSGRows.fromJson,
- (LabourReportEntity).toString(): LabourReportEntity.fromJson,
- (LabourReportRows).toString(): LabourReportRows.fromJson,
- (LabourReportTotal).toString(): LabourReportTotal.fromJson,
- (LabourReportVNEntity).toString(): LabourReportVNEntity.fromJson,
- (LabourReportVNRows).toString(): LabourReportVNRows.fromJson,
- (LabourReportVNTotal).toString(): LabourReportVNTotal.fromJson,
- (LabourRequestEditIndexEntity).toString(): LabourRequestEditIndexEntity.fromJson,
- (LabourRequestEditIndexTemplateList).toString(): LabourRequestEditIndexTemplateList.fromJson,
- (LabourRequestEditIndexDepartmentList).toString(): LabourRequestEditIndexDepartmentList.fromJson,
- (LabourRequestIndexEntity).toString(): LabourRequestIndexEntity.fromJson,
- (LabourRequestIndexDepartmentList).toString(): LabourRequestIndexDepartmentList.fromJson,
- (LabourRequestIndexStatusList).toString(): LabourRequestIndexStatusList.fromJson,
- (LabourRequestListEntity).toString(): LabourRequestListEntity.fromJson,
- (LabourRequestListRows).toString(): LabourRequestListRows.fromJson,
- (LabourRequestSGAddIndexEntity).toString(): LabourRequestSGAddIndexEntity.fromJson,
- (LabourRequestSGAddIndexOption).toString(): LabourRequestSGAddIndexOption.fromJson,
- (LabourRequestSGEditIndexEntity).toString(): LabourRequestSGEditIndexEntity.fromJson,
- (LabourRequestSGEditIndexJob).toString(): LabourRequestSGEditIndexJob.fromJson,
- (LabourRequestSGEditSelected).toString(): LabourRequestSGEditSelected.fromJson,
- (LabourRequestSGEditIndexChecked).toString(): LabourRequestSGEditIndexChecked.fromJson,
- (LabourRequestSGEntity).toString(): LabourRequestSGEntity.fromJson,
- (LabourRequestSGCountList).toString(): LabourRequestSGCountList.fromJson,
- (LabourRequestSGListEntity).toString(): LabourRequestSGListEntity.fromJson,
- (LabourRequestSGListRows).toString(): LabourRequestSGListRows.fromJson,
- (LabourRequestWorkFlowEntity).toString(): LabourRequestWorkFlowEntity.fromJson,
- (LabourRequestWorkFlowRecords).toString(): LabourRequestWorkFlowRecords.fromJson,
- (LabourReviewListEntity).toString(): LabourReviewListEntity.fromJson,
- (LabourReviewListRows).toString(): LabourReviewListRows.fromJson,
- (LabourReviewStatusEntity).toString(): LabourReviewStatusEntity.fromJson,
- (LabourReviewStatusRecords).toString(): LabourReviewStatusRecords.fromJson,
- (ReviseIndexSGEntity).toString(): ReviseIndexSGEntity.fromJson,
- (ReviseIndexSGStatusList).toString(): ReviseIndexSGStatusList.fromJson,
- (ReviseListSGEntity).toString(): ReviseListSGEntity.fromJson,
- (ReviseListSGRows).toString(): ReviseListSGRows.fromJson,
- (ReviseLogSGEntity).toString(): ReviseLogSGEntity.fromJson,
- (ReviseLogSGRecords).toString(): ReviseLogSGRecords.fromJson,
- (ReviseLogSGRecordsContent).toString(): ReviseLogSGRecordsContent.fromJson,
- (ReviseLogSGRecordsOption).toString(): ReviseLogSGRecordsOption.fromJson,
- (StaffDetailEntity).toString(): StaffDetailEntity.fromJson,
- (StaffDetailSGEntity).toString(): StaffDetailSGEntity.fromJson,
- (StaffDetailSGReviews).toString(): StaffDetailSGReviews.fromJson,
- (StaffDetailSGReviewsReviews).toString(): StaffDetailSGReviewsReviews.fromJson,
- (StaffJobHistorySGEntity).toString(): StaffJobHistorySGEntity.fromJson,
- (StaffJobHistorySGRows).toString(): StaffJobHistorySGRows.fromJson,
- (StaffLabourHistoryEntity).toString(): StaffLabourHistoryEntity.fromJson,
- (StaffLabourHistoryRows).toString(): StaffLabourHistoryRows.fromJson,
- (StaffLabourHistoryRowsSecurityIn).toString(): StaffLabourHistoryRowsSecurityIn.fromJson,
- (StaffLabourHistoryRowsSecurityOut).toString(): StaffLabourHistoryRowsSecurityOut.fromJson,
- (StaffLabourHistoryRowsWorkIn).toString(): StaffLabourHistoryRowsWorkIn.fromJson,
- (StaffLabourHistoryRowsWorkOut).toString(): StaffLabourHistoryRowsWorkOut.fromJson,
- (StaffRemarkHistoryEntity).toString(): StaffRemarkHistoryEntity.fromJson,
- (StaffRemarkHistoryRows).toString(): StaffRemarkHistoryRows.fromJson,
- (StaffReportVNEntity).toString(): StaffReportVNEntity.fromJson,
- (StaffRequestReportEntity).toString(): StaffRequestReportEntity.fromJson,
- (StaffReviewHistorySGEntity).toString(): StaffReviewHistorySGEntity.fromJson,
- (StaffReviewHistorySGReviews).toString(): StaffReviewHistorySGReviews.fromJson,
- (ServerTime).toString(): ServerTime.fromJson,
- };
- bool containsKey(String type) {
- return convertFuncMap.containsKey(type);
- }
- JsonConvertFunction? operator [](String key) {
- return convertFuncMap[key];
- }
- }
|