BlogDTO.fromJson constructor

BlogDTO.fromJson(
  1. Map<String, dynamic> json
)

Implementation

BlogDTO.fromJson(Map<String, dynamic> json) : super.fromJson(json) {
  title = json['title'];
  content = json['content'];
  if (json['photos'] != null) {
    photos = <PhotoDTO>[];
    json['photos'].forEach((v) {
      photos!.add(PhotoDTO.fromJson(v));
    });
  }
  if (json['tags'] != null) {
    tags = <TagDTO>[];
    json['tags'].forEach((v) {
      tags!.add(TagDTO.fromJson(v));
    });
  }
}