cloneTextParagraph function

TextParagraph cloneTextParagraph(
  1. TextParagraph block,
  2. String nextId(
    1. String kind
    ), {
  3. String? slotId,
})

Copies authored paragraph attributes while assigning a new durable identity.

Implementation

TextParagraph cloneTextParagraph(
  TextParagraph block,
  String Function(String kind) nextId, {
  String? slotId,
}) => TextParagraph(
  id: nextId('block'),
  runs: block.runs,
  attributes: block.attributes,
  alignment: block.alignment,
  direction: block.direction,
  role: block.role,
  slotId: slotId ?? block.slotId,
);