Media.fromJson constructor

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

Implementation

Media.fromJson(Map<String, dynamic> json) {
  id = json['id'];
  date = json['date'];
  dateGmt = json['date_gmt'];
  guid = json['guid'] != null ? new Guid.fromJson(json['guid']) : null;
  modified = json['modified'];
  modifiedGmt = json['modified_gmt'];
  slug = json['slug'];
  status = json['status'];
  type = json['type'];
  link = json['link'];
  title = json['title'] != null ? new Title.fromJson(json['title']) : null;
  author = json['author'];
  commentStatus = json['comment_status'];
  pingStatus = json['ping_status'];
  template = json['template'];
  /*if (json['meta'] != null) {
    meta = new List<Null>();
    json['meta'].forEach((v) {
      meta.add(new Null.fromJson(v));
    });
  }*/
  permalinkTemplate = json['permalink_template'];
  generatedSlug = json['generated_slug'];
  description = json['description'] != null
      ? new Description.fromJson(json['description'])
      : null;
  caption =
      json['caption'] != null ? new Caption.fromJson(json['caption']) : null;
  altText = json['alt_text'];
  mediaType = json['media_type'];
  mimeType = json['mime_type'];
  mediaDetails = json['media_details'] != null
      ? new MediaDetails.fromJson(json['media_details'])
      : null;
  post = json['post'];
  sourceUrl = json['source_url'];
  lLinks = json['_links'] != null ? new Links.fromJson(json['_links']) : null;
}