getLastSafe method

Paragraph getLastSafe()

Returns the last paragraph into the document and validate before to avoid exceptions.

Implementation

Paragraph getLastSafe() {
  if (paragraphs.isEmpty) paragraphs.add(Paragraph(lines: []));
  return paragraphs.last;
}