Document class
Document represents an AppFlowy Editor document structure.
It stores the root of the document.
DO NOT directly mutate the properties of a Document object.
Constructors
- Document({required Node root})
- Document.blank({bool withInitialText = false})
-
Creates a blank Document containing an empty root Node.
factory
- Document.empty()
-
Creates a empty document with a single text node.
factory
-
Document.fromJson(Map<
String, dynamic> json) -
Constructs a Document from a JSON strcuture.
factory
Properties
- first → Node?
-
First node of the document.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Returns whether the root Node does not contain
any text.
no setter
- last → Node?
-
Last node of the document.
no setter
- root → Node
-
The root Node of the Document
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
delete(
Path path, [int length = 1]) → bool - Deletes the Nodes at the given Path.
-
dispose(
) → void - Must call this method when the Document is no longer needed.
-
insert(
Path path, Iterable< Node> nodes) → bool - Inserts a Nodes at the given Path.
-
nodeAtPath(
Path path) → Node? -
Returns the node at the given
path
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object> - Encodes the Document into a JSON structure.
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
Path path, Attributes attributes) → bool - Updates the Node at the given Path
-
updateText(
Path path, Delta delta) → bool - Updates the Node with Delta at the given Path
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited