UBlogResponse.fromMap constructor
UBlogResponse.fromMap(
- Map<String, dynamic> json
)
Implementation
factory UBlogResponse.fromMap(Map<String, dynamic> json) => UBlogResponse(
id: json["id"] as String,
createdAt: DateTime.parse(json["createdAt"]),
jsonData: UBlogJson.fromMap(json["jsonData"]),
tags: List<int>.from(json["tags"]!.map((dynamic x) => x)),
creator: json["creator"] == null ? null : UUserResponse.fromMap(json["creator"]),
creatorId: json["creatorId"],
adminUserIds: json["adminUserIds"] == null ? <String>[] : List<String>.from(json["adminUserIds"]!.map((dynamic x) => x)),
title: json["title"] as String,
subtitle: json["subtitle"],
slug: json["slug"],
content: json["content"],
media: json["media"] == null ? <UMediaResponse>[] : List<UMediaResponse>.from(json["media"]!.map((dynamic x) => UMediaResponse.fromMap(x))),
categories: json["categories"] == null ? <UCategoryResponse>[] : List<UCategoryResponse>.from(json["categories"]!.map((dynamic x) => UCategoryResponse.fromMap(x))),
comments: json["comments"] == null ? <UCommentResponse>[] : List<UCommentResponse>.from(json["comments"]!.map((dynamic x) => UCommentResponse.fromMap(x))),
commentCount: json["commentCount"],
code: json["code"],
description: json["description"],
type: json["type"],
latitude: json["latitude"],
longitude: json["longitude"],
parentId: json["parentId"],
children: json["children"] == null ? <UBlogResponse>[] : List<UBlogResponse>.from(json["children"]!.map((dynamic x) => UBlogResponse.fromMap(x))),
childrenCount: json["childrenCount"],
);