PageDetails.fromJson constructor

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

Implementation

factory PageDetails.fromJson(Map<String, dynamic> json) => PageDetails(
      id: json["_id"],
      name: json["name"],
      clientId: json["clientId"],
      pageId: json["pageId"],
      status: json["status"],
      properties: json["properties"] == null
          ? null
          : Properties.fromJson(json["properties"]),
      components: json["components"] == null
          ? []
          : List<Component>.from(
              json["components"]!.map((x) => Component.fromJson(x))),
      imageKey: json["imageKey"],
      createdBy: json["createdBy"],
      appVersion: json["appVersion"],
      tag: json["tag"],
      usedIn: json["usedIn"] == null
          ? []
          : List<String>.from(json["usedIn"]!.map((x) => x)),
      createdAt: json["createdAt"] == null
          ? null
          : DateTime.parse(json["createdAt"]),
      updatedAt: json["updatedAt"] == null
          ? null
          : DateTime.parse(json["updatedAt"]),
      v: json["__v"],
    );