import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/facility_index_entity.dart'; FacilityIndexEntity $FacilityIndexEntityFromJson(Map json) { final FacilityIndexEntity facilityIndexEntity = FacilityIndexEntity(); final String? id = jsonConvert.convert(json['id']); if (id != null) { facilityIndexEntity.id = id; } final String? icon = jsonConvert.convert(json['icon']); if (icon != null) { facilityIndexEntity.icon = icon; } final String? name = jsonConvert.convert(json['name']); if (name != null) { facilityIndexEntity.name = name; } final List? mapResources = (json['map_resources'] as List?) ?.map( (e) => jsonConvert.convert(e) as String) .toList(); if (mapResources != null) { facilityIndexEntity.mapResources = mapResources; } return facilityIndexEntity; } Map $FacilityIndexEntityToJson(FacilityIndexEntity entity) { final Map data = {}; data['id'] = entity.id; data['icon'] = entity.icon; data['name'] = entity.name; data['map_resources'] = entity.mapResources; return data; } extension FacilityIndexEntityExtension on FacilityIndexEntity { FacilityIndexEntity copyWith({ String? id, String? icon, String? name, List? mapResources, }) { return FacilityIndexEntity() ..id = id ?? this.id ..icon = icon ?? this.icon ..name = name ?? this.name ..mapResources = mapResources ?? this.mapResources; } }