import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/response/labour_request_index_entity.dart'; LabourRequestIndexEntity $LabourRequestIndexEntityFromJson(Map json) { final LabourRequestIndexEntity labourRequestIndexEntity = LabourRequestIndexEntity(); final List? departmentList = (json['department_list'] as List?)?.map( (e) => jsonConvert.convert(e) as LabourRequestIndexDepartmentList).toList(); if (departmentList != null) { labourRequestIndexEntity.departmentList = departmentList; } final List? statusList = (json['status_list'] as List?)?.map( (e) => jsonConvert.convert(e) as LabourRequestIndexStatusList).toList(); if (statusList != null) { labourRequestIndexEntity.statusList = statusList; } return labourRequestIndexEntity; } Map $LabourRequestIndexEntityToJson(LabourRequestIndexEntity entity) { final Map data = {}; data['department_list'] = entity.departmentList?.map((v) => v.toJson()).toList(); data['status_list'] = entity.statusList?.map((v) => v.toJson()).toList(); return data; } extension LabourRequestIndexEntityExtension on LabourRequestIndexEntity { LabourRequestIndexEntity copyWith({ List? departmentList, List? statusList, }) { return LabourRequestIndexEntity() ..departmentList = departmentList ?? this.departmentList ..statusList = statusList ?? this.statusList; } } LabourRequestIndexDepartmentList $LabourRequestIndexDepartmentListFromJson(Map json) { final LabourRequestIndexDepartmentList labourRequestIndexDepartmentList = LabourRequestIndexDepartmentList(); final int? value = jsonConvert.convert(json['value']); if (value != null) { labourRequestIndexDepartmentList.value = value; } final String? txt = jsonConvert.convert(json['txt']); if (txt != null) { labourRequestIndexDepartmentList.txt = txt; } final String? selected = jsonConvert.convert(json['selected']); if (selected != null) { labourRequestIndexDepartmentList.selected = selected; } return labourRequestIndexDepartmentList; } Map $LabourRequestIndexDepartmentListToJson(LabourRequestIndexDepartmentList entity) { final Map data = {}; data['value'] = entity.value; data['txt'] = entity.txt; data['selected'] = entity.selected; return data; } extension LabourRequestIndexDepartmentListExtension on LabourRequestIndexDepartmentList { LabourRequestIndexDepartmentList copyWith({ int? value, String? txt, String? selected, }) { return LabourRequestIndexDepartmentList() ..value = value ?? this.value ..txt = txt ?? this.txt ..selected = selected ?? this.selected; } } LabourRequestIndexStatusList $LabourRequestIndexStatusListFromJson(Map json) { final LabourRequestIndexStatusList labourRequestIndexStatusList = LabourRequestIndexStatusList(); final int? value = jsonConvert.convert(json['value']); if (value != null) { labourRequestIndexStatusList.value = value; } final String? txt = jsonConvert.convert(json['txt']); if (txt != null) { labourRequestIndexStatusList.txt = txt; } final String? selected = jsonConvert.convert(json['selected']); if (selected != null) { labourRequestIndexStatusList.selected = selected; } return labourRequestIndexStatusList; } Map $LabourRequestIndexStatusListToJson(LabourRequestIndexStatusList entity) { final Map data = {}; data['value'] = entity.value; data['txt'] = entity.txt; data['selected'] = entity.selected; return data; } extension LabourRequestIndexStatusListExtension on LabourRequestIndexStatusList { LabourRequestIndexStatusList copyWith({ int? value, String? txt, String? selected, }) { return LabourRequestIndexStatusList() ..value = value ?? this.value ..txt = txt ?? this.txt ..selected = selected ?? this.selected; } }