labour_request_index_entity.g.dart 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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<LabourRequestIndexStatusList>? statusList = (json['status_list'] as List<dynamic>?)?.map(
  11. (e) => jsonConvert.convert<LabourRequestIndexStatusList>(e) as LabourRequestIndexStatusList).toList();
  12. if (statusList != null) {
  13. labourRequestIndexEntity.statusList = statusList;
  14. }
  15. return labourRequestIndexEntity;
  16. }
  17. Map<String, dynamic> $LabourRequestIndexEntityToJson(LabourRequestIndexEntity entity) {
  18. final Map<String, dynamic> data = <String, dynamic>{};
  19. data['department_list'] = entity.departmentList?.map((v) => v.toJson()).toList();
  20. data['status_list'] = entity.statusList?.map((v) => v.toJson()).toList();
  21. return data;
  22. }
  23. extension LabourRequestIndexEntityExtension on LabourRequestIndexEntity {
  24. LabourRequestIndexEntity copyWith({
  25. List<LabourRequestIndexDepartmentList>? departmentList,
  26. List<LabourRequestIndexStatusList>? statusList,
  27. }) {
  28. return LabourRequestIndexEntity()
  29. ..departmentList = departmentList ?? this.departmentList
  30. ..statusList = statusList ?? this.statusList;
  31. }
  32. }
  33. LabourRequestIndexDepartmentList $LabourRequestIndexDepartmentListFromJson(Map<String, dynamic> json) {
  34. final LabourRequestIndexDepartmentList labourRequestIndexDepartmentList = LabourRequestIndexDepartmentList();
  35. final int? value = jsonConvert.convert<int>(json['value']);
  36. if (value != null) {
  37. labourRequestIndexDepartmentList.value = value;
  38. }
  39. final String? txt = jsonConvert.convert<String>(json['txt']);
  40. if (txt != null) {
  41. labourRequestIndexDepartmentList.txt = txt;
  42. }
  43. final String? selected = jsonConvert.convert<String>(json['selected']);
  44. if (selected != null) {
  45. labourRequestIndexDepartmentList.selected = selected;
  46. }
  47. return labourRequestIndexDepartmentList;
  48. }
  49. Map<String, dynamic> $LabourRequestIndexDepartmentListToJson(LabourRequestIndexDepartmentList entity) {
  50. final Map<String, dynamic> data = <String, dynamic>{};
  51. data['value'] = entity.value;
  52. data['txt'] = entity.txt;
  53. data['selected'] = entity.selected;
  54. return data;
  55. }
  56. extension LabourRequestIndexDepartmentListExtension on LabourRequestIndexDepartmentList {
  57. LabourRequestIndexDepartmentList copyWith({
  58. int? value,
  59. String? txt,
  60. String? selected,
  61. }) {
  62. return LabourRequestIndexDepartmentList()
  63. ..value = value ?? this.value
  64. ..txt = txt ?? this.txt
  65. ..selected = selected ?? this.selected;
  66. }
  67. }
  68. LabourRequestIndexStatusList $LabourRequestIndexStatusListFromJson(Map<String, dynamic> json) {
  69. final LabourRequestIndexStatusList labourRequestIndexStatusList = LabourRequestIndexStatusList();
  70. final int? value = jsonConvert.convert<int>(json['value']);
  71. if (value != null) {
  72. labourRequestIndexStatusList.value = value;
  73. }
  74. final String? txt = jsonConvert.convert<String>(json['txt']);
  75. if (txt != null) {
  76. labourRequestIndexStatusList.txt = txt;
  77. }
  78. final String? selected = jsonConvert.convert<String>(json['selected']);
  79. if (selected != null) {
  80. labourRequestIndexStatusList.selected = selected;
  81. }
  82. return labourRequestIndexStatusList;
  83. }
  84. Map<String, dynamic> $LabourRequestIndexStatusListToJson(LabourRequestIndexStatusList entity) {
  85. final Map<String, dynamic> data = <String, dynamic>{};
  86. data['value'] = entity.value;
  87. data['txt'] = entity.txt;
  88. data['selected'] = entity.selected;
  89. return data;
  90. }
  91. extension LabourRequestIndexStatusListExtension on LabourRequestIndexStatusList {
  92. LabourRequestIndexStatusList copyWith({
  93. int? value,
  94. String? txt,
  95. String? selected,
  96. }) {
  97. return LabourRequestIndexStatusList()
  98. ..value = value ?? this.value
  99. ..txt = txt ?? this.txt
  100. ..selected = selected ?? this.selected;
  101. }
  102. }