labour_request_index_entity.g.dart 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import 'package:domain/generated/json/base/json_convert_content.dart';
  2. import 'package:domain/entity/response/labour_request_index_entity.dart';
  3. LabourRequestIndexEntity $LabourRequestIndexEntityFromJson(Map<String, dynamic> json) {
  4. final LabourRequestIndexEntity labourRequestIndexEntity = LabourRequestIndexEntity();
  5. final List<LabourRequestIndexDepartmentList>? departmentList = (json['department_list'] as List<dynamic>?)?.map(
  6. (e) => jsonConvert.convert<LabourRequestIndexDepartmentList>(e) as LabourRequestIndexDepartmentList).toList();
  7. if (departmentList != null) {
  8. labourRequestIndexEntity.departmentList = departmentList;
  9. }
  10. final List<LabourRequestIndexDepartmentList>? outletList = (json['outlet_list'] as List<dynamic>?)?.map(
  11. (e) => jsonConvert.convert<LabourRequestIndexDepartmentList>(e) as LabourRequestIndexDepartmentList).toList();
  12. if (outletList != null) {
  13. labourRequestIndexEntity.outletList = outletList;
  14. }
  15. final List<LabourRequestIndexStatusList>? statusList = (json['status_list'] as List<dynamic>?)?.map(
  16. (e) => jsonConvert.convert<LabourRequestIndexStatusList>(e) as LabourRequestIndexStatusList).toList();
  17. if (statusList != null) {
  18. labourRequestIndexEntity.statusList = statusList;
  19. }
  20. return labourRequestIndexEntity;
  21. }
  22. Map<String, dynamic> $LabourRequestIndexEntityToJson(LabourRequestIndexEntity entity) {
  23. final Map<String, dynamic> data = <String, dynamic>{};
  24. data['department_list'] = entity.departmentList?.map((v) => v.toJson()).toList();
  25. data['outlet_list'] = entity.outletList?.map((v) => v.toJson()).toList();
  26. data['status_list'] = entity.statusList?.map((v) => v.toJson()).toList();
  27. return data;
  28. }
  29. extension LabourRequestIndexEntityExtension on LabourRequestIndexEntity {
  30. LabourRequestIndexEntity copyWith({
  31. List<LabourRequestIndexDepartmentList>? departmentList,
  32. List<LabourRequestIndexDepartmentList>? outletList,
  33. List<LabourRequestIndexStatusList>? statusList,
  34. }) {
  35. return LabourRequestIndexEntity()
  36. ..departmentList = departmentList ?? this.departmentList
  37. ..outletList = outletList ?? this.outletList
  38. ..statusList = statusList ?? this.statusList;
  39. }
  40. }
  41. LabourRequestIndexDepartmentList $LabourRequestIndexDepartmentListFromJson(Map<String, dynamic> json) {
  42. final LabourRequestIndexDepartmentList labourRequestIndexDepartmentList = LabourRequestIndexDepartmentList();
  43. final String? value = jsonConvert.convert<String>(json['value']);
  44. if (value != null) {
  45. labourRequestIndexDepartmentList.value = value;
  46. }
  47. final String? txt = jsonConvert.convert<String>(json['txt']);
  48. if (txt != null) {
  49. labourRequestIndexDepartmentList.txt = txt;
  50. }
  51. final String? selected = jsonConvert.convert<String>(json['selected']);
  52. if (selected != null) {
  53. labourRequestIndexDepartmentList.selected = selected;
  54. }
  55. return labourRequestIndexDepartmentList;
  56. }
  57. Map<String, dynamic> $LabourRequestIndexDepartmentListToJson(LabourRequestIndexDepartmentList entity) {
  58. final Map<String, dynamic> data = <String, dynamic>{};
  59. data['value'] = entity.value;
  60. data['txt'] = entity.txt;
  61. data['selected'] = entity.selected;
  62. return data;
  63. }
  64. extension LabourRequestIndexDepartmentListExtension on LabourRequestIndexDepartmentList {
  65. LabourRequestIndexDepartmentList copyWith({
  66. String? value,
  67. String? txt,
  68. String? selected,
  69. }) {
  70. return LabourRequestIndexDepartmentList()
  71. ..value = value ?? this.value
  72. ..txt = txt ?? this.txt
  73. ..selected = selected ?? this.selected;
  74. }
  75. }
  76. LabourRequestIndexStatusList $LabourRequestIndexStatusListFromJson(Map<String, dynamic> json) {
  77. final LabourRequestIndexStatusList labourRequestIndexStatusList = LabourRequestIndexStatusList();
  78. final String? value = jsonConvert.convert<String>(json['value']);
  79. if (value != null) {
  80. labourRequestIndexStatusList.value = value;
  81. }
  82. final String? txt = jsonConvert.convert<String>(json['txt']);
  83. if (txt != null) {
  84. labourRequestIndexStatusList.txt = txt;
  85. }
  86. final String? selected = jsonConvert.convert<String>(json['selected']);
  87. if (selected != null) {
  88. labourRequestIndexStatusList.selected = selected;
  89. }
  90. return labourRequestIndexStatusList;
  91. }
  92. Map<String, dynamic> $LabourRequestIndexStatusListToJson(LabourRequestIndexStatusList entity) {
  93. final Map<String, dynamic> data = <String, dynamic>{};
  94. data['value'] = entity.value;
  95. data['txt'] = entity.txt;
  96. data['selected'] = entity.selected;
  97. return data;
  98. }
  99. extension LabourRequestIndexStatusListExtension on LabourRequestIndexStatusList {
  100. LabourRequestIndexStatusList copyWith({
  101. String? value,
  102. String? txt,
  103. String? selected,
  104. }) {
  105. return LabourRequestIndexStatusList()
  106. ..value = value ?? this.value
  107. ..txt = txt ?? this.txt
  108. ..selected = selected ?? this.selected;
  109. }
  110. }