Document class abstract

A read-only document with styled text and multimedia elements.

A Document is comprised of a list of DocumentNodes, which describe the type and substance of a piece of content within the document. For example, a ParagraphNode holds a single paragraph of text within the document.

New types of content can be added by subclassing DocumentNode.

To represent a specific location within a Document, see DocumentPosition.

A Document has no opinion on the visual presentation of its content.

To edit the content of a document, see DocumentEditor.

Mixed-in types
Implementers
Available extensions

Constructors

Document()

Properties

hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
nodes List<DocumentNode>
Returns all of the content within the document as a list of DocumentNodes.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
inherited
getNode(DocumentPosition position) DocumentNode?
Returns the DocumentNode at the given position, or null if no such node exists in this Document.
getNodeAfter(DocumentNode node) DocumentNode?
Returns the DocumentNode that appears immediately after the given node in this Document, or null if the given node is the last node, or the given node does not exist in this Document.
getNodeAt(int index) DocumentNode?
Returns the DocumentNode at the given index, or null if no such node exists.
getNodeBefore(DocumentNode node) DocumentNode?
Returns the DocumentNode that appears immediately before the given node in this Document, or null if the given node is the first node, or the given node does not exist in this Document.
getNodeById(String nodeId) DocumentNode?
Returns the DocumentNode with the given nodeId, or null if no such node exists.
getNodeIndex(DocumentNode node) int
Returns the index of the given node, or -1 if the node does not exist within this Document.
getNodeIndexById(String nodeId) int
Returns the index of the DocumentNode in this Document that has the given nodeId, or -1 if the node does not exist.
getNodesInside(DocumentPosition position1, DocumentPosition position2) List<DocumentNode>
Returns all DocumentNodes from position1 to position2, including the nodes at position1 and position2.
getRangeBetween(DocumentPosition position1, DocumentPosition position2) DocumentRange
Returns a DocumentRange that ranges from position1 to position2, including position1 and position2.
hasEquivalentContent(Document other) bool
Returns true if the content in the other document is equivalent to the content in this document, ignoring any details that are unrelated to content, such as individual node IDs.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited