facility_index_entity.g.dart 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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>?)
  18. ?.map(
  19. (e) => jsonConvert.convert<String>(e) as String)
  20. .toList();
  21. if (mapResources != null) {
  22. facilityIndexEntity.mapResources = mapResources;
  23. }
  24. return facilityIndexEntity;
  25. }
  26. Map<String, dynamic> $FacilityIndexEntityToJson(FacilityIndexEntity entity) {
  27. final Map<String, dynamic> data = <String, dynamic>{};
  28. data['id'] = entity.id;
  29. data['icon'] = entity.icon;
  30. data['name'] = entity.name;
  31. data['map_resources'] = entity.mapResources;
  32. return data;
  33. }
  34. extension FacilityIndexEntityExtension on FacilityIndexEntity {
  35. FacilityIndexEntity copyWith({
  36. String? id,
  37. String? icon,
  38. String? name,
  39. List<String>? mapResources,
  40. }) {
  41. return FacilityIndexEntity()
  42. ..id = id ?? this.id
  43. ..icon = icon ?? this.icon
  44. ..name = name ?? this.name
  45. ..mapResources = mapResources ?? this.mapResources;
  46. }
  47. }