objectTypeFromJson function

dynamic objectTypeFromJson(
  1. Map<String, dynamic> json
)

Implementation

objectTypeFromJson(Map<String, dynamic> json) {
  switch (json['type']) {
    case 'link':
      return OrgLink.fromJson(json);
    case 'bold':
      return OrgBold.fromJson(json);
    case 'italic':
      return OrgItalic.fromJson(json);
    case 'code':
      return OrgCode.fromJson(json);
    case 'verbatim':
      return OrgVerbatim.fromJson(json);
    case 'strike-through':
      return OrgStrikeThrough.fromJson(json);
    case 'underline':
      return OrgUnderline.fromJson(json);
    case 'superscript':
      return OrgSuperscript.fromJson(json);
    case 'subscript':
      return OrgSubscript.fromJson(json);
    case 'text':
      return OrgText.fromJson(json);
    case 'timestamp':
      return OrgTimestamp.fromJson(json);
    case 'footnote-reference':
      return OrgFootnoteReference.fromJson(json);
    case 'latex-fragment':
      return OrgLatexFragment.fromJson(json);
    case 'entity':
      return OrgEntity.fromJson(json);
    case 'table-cell':
      return OrgTableCell.fromJson(json);
    default:
      throw ArgumentError(json['type'] + ' is not valid ObjectTpe.', 'json');
  }
}