Document.blank constructor

Document.blank({
  1. bool withInitialText = false,
})

Creates a blank Document containing an empty root Node.

If withInitialText is true, the document will contain an empty paragraph Node.

Implementation

factory Document.blank({bool withInitialText = false}) {
  final root = Node(
    type: 'page',
    children: withInitialText ? [paragraphNode()] : [],
  );
  return Document(
    root: root,
  );
}