Paragraph constructor
Paragraph({
- required List<
Line> lines, - required ParagraphType type,
- Map<
String, dynamic> ? blockAttributes,
Implementation
Paragraph({
required List<Line> lines,
required this.type,
this.blockAttributes,
}) : _lines = List<Line>.from(lines),
id = nanoid(8),
_sealed = type == ParagraphType.block
? true
: lines.isNotEmpty && lines.length == 1 && lines.first.isNotEmpty
? lines.first.length > 1
? false
: lines.single.isNewLine || lines.single.isEmbedFragment
: false;