import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/latest_news_detail_entity.dart'; LatestNewsDetailEntity $LatestNewsDetailEntityFromJson(Map json) { final LatestNewsDetailEntity latestNewsDetailEntity = LatestNewsDetailEntity(); final String? id = jsonConvert.convert(json['id']); if (id != null) { latestNewsDetailEntity.id = id; } final int? type = jsonConvert.convert(json['type']); if (type != null) { latestNewsDetailEntity.type = type; } final String? title = jsonConvert.convert(json['title']); if (title != null) { latestNewsDetailEntity.title = title; } final String? coverImage = jsonConvert.convert(json['cover_image']); if (coverImage != null) { latestNewsDetailEntity.coverImage = coverImage; } final String? content = jsonConvert.convert(json['content']); if (content != null) { latestNewsDetailEntity.content = content; } final String? createdAt = jsonConvert.convert(json['created_at']); if (createdAt != null) { latestNewsDetailEntity.createdAt = createdAt; } return latestNewsDetailEntity; } Map $LatestNewsDetailEntityToJson(LatestNewsDetailEntity entity) { final Map data = {}; data['id'] = entity.id; data['type'] = entity.type; data['title'] = entity.title; data['cover_image'] = entity.coverImage; data['content'] = entity.content; data['created_at'] = entity.createdAt; return data; } extension LatestNewsDetailEntityExtension on LatestNewsDetailEntity { LatestNewsDetailEntity copyWith({ String? id, int? type, String? title, String? coverImage, String? content, String? createdAt, }) { return LatestNewsDetailEntity() ..id = id ?? this.id ..type = type ?? this.type ..title = title ?? this.title ..coverImage = coverImage ?? this.coverImage ..content = content ?? this.content ..createdAt = createdAt ?? this.createdAt; } }