Paragraph.fromRawEmbed constructor

Paragraph.fromRawEmbed({
  1. required Object data,
  2. Map<String, dynamic>? attributes,
  3. Map<String, dynamic>? blockAttributes,
})

Constructs a Paragraph instance from a Object embed. operation is the Quill Delta operation representing the embed.

Implementation

factory Paragraph.fromRawEmbed(
    {required Object data,
    Map<String, dynamic>? attributes,
    Map<String, dynamic>? blockAttributes}) {
  return Paragraph(
    lines: <Line>[
      Line.fromData(data: data, attributes: attributes),
    ],
    blockAttributes: blockAttributes,
    type: data is String
        ? blockAttributes != null
            ? ParagraphType.block
            : ParagraphType.inline
        : ParagraphType.embed,
  )..seal();
}