toJson method
Converts to JSON map.
Implementation
Map<String, dynamic> toJson() {
return {
if (headerLevel != null) 'headerLevel': headerLevel,
if (divider != null) 'divider': divider!.toJson(),
if (callout != null) 'callout': callout!.toJson(),
if (codeBlock != null) 'codeBlock': codeBlock!.toJson(),
if (listMeta != null) 'listMeta': listMeta!.toJson(),
if (tableMeta != null) 'tableMeta': tableMeta!.toJson(),
if (emphasis != null) 'emphasis': emphasis!.toJson(),
if (xmlMeta != null) 'xmlMeta': xmlMeta!.toJson(),
if (yamlMeta != null) 'yamlMeta': yamlMeta!.toJson(),
if (jsonMeta != null) 'jsonMeta': jsonMeta!.toJson(),
if (whitespace != null) 'whitespace': whitespace!.toJson(),
if (children != null)
'children': children!.map((k, v) => MapEntry(k, v.toJson())),
};
}