fromJson static method

EmbeddableObject fromJson(
  1. Map<String, dynamic> json
)

Implementation

static EmbeddableObject fromJson(Map<String, dynamic> json) {
  final type = json[kTypeKey] as String?;
  final inline = json[kInlineKey] as bool;
  final data = Map<String, dynamic>.from(json);
  data.remove(kTypeKey);
  data.remove(kInlineKey);
  if (inline) {
    return SpanEmbed(type!, data: data);
  }
  return BlockEmbed(type!, data: data);
}