ContentItem.fromJson constructor

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

Converts the JSON representation of the content item to an instance of ContentItem.

Implementation

factory ContentItem.fromJson(Map<String, dynamic> json) {
  final type = VyuhBinding.instance.content.provider.schemaType(json);
  return VyuhBinding.instance.content.fromJson<ContentItem>(json) ??
      UnknownContentItem(
        missingSchemaType: type,
        jsonPayload: json,
      );
}