elementTypeFromJson function
dynamic
elementTypeFromJson(
- Map<String, dynamic> json
)
Implementation
elementTypeFromJson(Map<String, dynamic> json) {
switch (json['type']) {
case 'headline':
return OrgHeadline.fromJson(json);
case 'planning':
return OrgPlanning.fromJson(json);
case 'node-property':
return OrgNodeProperty.fromJson(json);
case 'list-item-tag':
return OrgListItemTag.fromJson(json);
case 'comment-block':
return OrgCommentBlock.fromJson(json);
case 'src-block':
return OrgSrcBlock.fromJson(json);
case 'example-block':
return OrgExampleBlock.fromJson(json);
case 'export-block':
return OrgExportBlock.fromJson(json);
case 'keyword':
return OrgKeyword.fromJson(json);
case 'table-row':
return OrgTableRow.fromJson(json);
case 'comment':
return OrgComment.fromJson(json);
case 'fixed-width':
return OrgFixedWith.fromJson(json);
case 'clock':
return OrgClock.fromJson(json);
case 'latex-environment':
return OrgLatexEnvironment.fromJson(json);
case 'horizontal-rule':
return OrgHorizontalRule.fromJson(json);
case 'diary-sexp':
return OrgDiarySexp.fromJson(json);
case 'paragraph':
return OrgParagraph.fromJson(json);
default:
throw ArgumentError('is not a valid ElementType', 'json');
}
}