Story<Content>.fromJson constructor

Story<Content>.fromJson(
  1. JSONMap json,
  2. Content contentBuilder(
    1. JSONMap
    )
)

Implementation

factory Story.fromJson(JSONMap json, Content Function(JSONMap) contentBuilder) => Story(
      name: json["name"],
      createdAt: DateTime.parse(json["created_at"]),
      publishedAt: mapIfNotNull(json["published_at"] as String?, DateTime.tryParse),
      id: json["id"],
      uuid: json["uuid"],
      content: contentBuilder(JSONMap.from(json["content"])),
      slug: json["slug"],
      fullSlug: json["full_slug"],
      sortByDate: json["sort_by_date"],
      position: json["position"],
      tagList: List.from(json["tag_list"]),
      isStartpage: json["is_startpage"],
      parentId: json["parent_id"],
      metaData: json["meta_data"],
      groupId: json["group_id"],
      firstPublishedAt: mapIfNotNull(json["first_published_at"] as String?, DateTime.tryParse),
      releaseId: json["release_id"],
      language: json["lang"],
      path: json["path"],
      alternates: List.from(json["alternates"]),
      defaultFullSlug: json["default_full_slug"],
      translatedSlugs: json["translated_slugs"],
    );