import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/property_news_detail_entity.dart'; PropertyNewsDetailEntity $PropertyNewsDetailEntityFromJson( Map json) { final PropertyNewsDetailEntity propertyNewsDetailEntity = PropertyNewsDetailEntity(); final int? id = jsonConvert.convert(json['id']); if (id != null) { propertyNewsDetailEntity.id = id; } final String? title = jsonConvert.convert(json['title']); if (title != null) { propertyNewsDetailEntity.title = title; } final String? coverImage = jsonConvert.convert(json['cover_image']); if (coverImage != null) { propertyNewsDetailEntity.coverImage = coverImage; } final String? content = jsonConvert.convert(json['content']); if (content != null) { propertyNewsDetailEntity.content = content; } final String? createdAt = jsonConvert.convert(json['created_at']); if (createdAt != null) { propertyNewsDetailEntity.createdAt = createdAt; } final int? likesCount = jsonConvert.convert(json['likes_count']); if (likesCount != null) { propertyNewsDetailEntity.likesCount = likesCount; } final bool? liked = jsonConvert.convert(json['liked']); if (liked != null) { propertyNewsDetailEntity.liked = liked; } return propertyNewsDetailEntity; } Map $PropertyNewsDetailEntityToJson( PropertyNewsDetailEntity entity) { final Map data = {}; data['id'] = entity.id; data['title'] = entity.title; data['cover_image'] = entity.coverImage; data['content'] = entity.content; data['created_at'] = entity.createdAt; data['likes_count'] = entity.likesCount; data['liked'] = entity.liked; return data; } extension PropertyNewsDetailEntityExtension on PropertyNewsDetailEntity { PropertyNewsDetailEntity copyWith({ int? id, String? title, String? coverImage, String? content, String? createdAt, int? likesCount, bool? liked, }) { return PropertyNewsDetailEntity() ..id = id ?? this.id ..title = title ?? this.title ..coverImage = coverImage ?? this.coverImage ..content = content ?? this.content ..createdAt = createdAt ?? this.createdAt ..likesCount = likesCount ?? this.likesCount ..liked = liked ?? this.liked; } }