CollectionContent.fromJson constructor
Implementation
factory CollectionContent.fromJson(Map<String, dynamic> json) {
if (json['type'] == 'article') {
return CollectionContent.article(Article.fromJson(json));
} else if (json['type'] == 'collection') {
return CollectionContent.collection(Collection.fromJson(json));
}
throw Exception('Unknown type for CollectionContent: ${json['type']}');
}