facility_index_entity.g.dart 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import 'package:domain/generated/json/base/json_convert_content.dart';
  2. import 'package:domain/entity/facility_index_entity.dart';
  3. FacilityIndexEntity $FacilityIndexEntityFromJson(Map<String, dynamic> json) {
  4. final FacilityIndexEntity facilityIndexEntity = FacilityIndexEntity();
  5. final String? id = jsonConvert.convert<String>(json['id']);
  6. if (id != null) {
  7. facilityIndexEntity.id = id;
  8. }
  9. final String? icon = jsonConvert.convert<String>(json['icon']);
  10. if (icon != null) {
  11. facilityIndexEntity.icon = icon;
  12. }
  13. final String? name = jsonConvert.convert<String>(json['name']);
  14. if (name != null) {
  15. facilityIndexEntity.name = name;
  16. }
  17. final List<String>? mapResources = (json['map_resources'] as List<dynamic>?)?.map(
  18. (e) => jsonConvert.convert<String>(e) as String).toList();
  19. if (mapResources != null) {
  20. facilityIndexEntity.mapResources = mapResources;
  21. }
  22. return facilityIndexEntity;
  23. }
  24. Map<String, dynamic> $FacilityIndexEntityToJson(FacilityIndexEntity entity) {
  25. final Map<String, dynamic> data = <String, dynamic>{};
  26. data['id'] = entity.id;
  27. data['icon'] = entity.icon;
  28. data['name'] = entity.name;
  29. data['map_resources'] = entity.mapResources;
  30. return data;
  31. }
  32. extension FacilityIndexEntityExtension on FacilityIndexEntity {
  33. FacilityIndexEntity copyWith({
  34. String? id,
  35. String? icon,
  36. String? name,
  37. List<String>? mapResources,
  38. }) {
  39. return FacilityIndexEntity()
  40. ..id = id ?? this.id
  41. ..icon = icon ?? this.icon
  42. ..name = name ?? this.name
  43. ..mapResources = mapResources ?? this.mapResources;
  44. }
  45. }