KeyMetadata.fromJson constructor
Creates from JSON map.
Implementation
factory KeyMetadata.fromJson(Map<String, dynamic> json) {
return KeyMetadata(
headerLevel: json['headerLevel'] as int?,
divider: json['divider'] != null
? DividerMeta.fromJson(json['divider'] as Map<String, dynamic>)
: null,
callout: json['callout'] != null
? CalloutMeta.fromJson(json['callout'] as Map<String, dynamic>)
: null,
codeBlock: json['codeBlock'] != null
? CodeBlockMeta.fromJson(json['codeBlock'] as Map<String, dynamic>)
: null,
listMeta: json['listMeta'] != null
? ListMeta.fromJson(json['listMeta'] as Map<String, dynamic>)
: null,
tableMeta: json['tableMeta'] != null
? TableMeta.fromJson(json['tableMeta'] as Map<String, dynamic>)
: null,
emphasis: json['emphasis'] != null
? EmphasisMeta.fromJson(json['emphasis'] as Map<String, dynamic>)
: null,
xmlMeta: json['xmlMeta'] != null
? XmlMeta.fromJson(json['xmlMeta'] as Map<String, dynamic>)
: null,
yamlMeta: json['yamlMeta'] != null
? YamlMeta.fromJson(json['yamlMeta'] as Map<String, dynamic>)
: null,
jsonMeta: json['jsonMeta'] != null
? JsonMeta.fromJson(json['jsonMeta'] as Map<String, dynamic>)
: null,
whitespace: json['whitespace'] != null
? WhitespaceMeta.fromJson(json['whitespace'] as Map<String, dynamic>)
: null,
children: json['children'] != null
? (json['children'] as Map<String, dynamic>).map(
(k, v) =>
MapEntry(k, KeyMetadata.fromJson(v as Map<String, dynamic>)),
)
: null,
);
}