Document class Null safety

The rich text document


Creates new empty document.
Document.fromDelta(Delta delta)
Creates new document from provided delta.
Document.fromJson(List data)
Creates new document from provided JSON data.


changes Stream<Tuple3<Delta, Delta, ChangeSource>>
Stream of Changes applied to this document.
hashCode int
The hash code for this object. [...]
read-only, inherited
hasRedo bool
hasUndo bool
length int
Length of this document.
root → Root
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


close() → void
collectAllIndividualStyles(int index, int len) List<Tuple2<int, Style>>
Returns all styles for each node within selection
collectAllStyles(int index, int len) List<Style>
Returns all styles for any character within the specified text range.
collectStyle(int index, int len) Style
Only attributes applied to all characters within this range are included in the result.
compose(Delta delta, ChangeSource changeSource) → void
Composes change Delta into this document. [...]
delete(int index, int len) Delta
Deletes length of characters from this document starting at index. [...]
format(int index, int len, Attribute? attribute) Delta
Formats segment of this document with specified attribute. [...]
getPlainText(int index, int len) String
Returns plain text within the specified text range.
insert(int index, Object? data, {int replaceLength = 0}) Delta
Inserts data in this document at specified index. [...]
isEmpty() bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
queryChild(int offset) → ChildQuery
Returns Line located at specified character offset.
querySegmentLeafNode(int offset) Tuple2<Line?, Leaf?>
Given offset, find its leaf node in document
redo() Tuple2
replace(int index, int len, Object? data) Delta
Replaces length of characters starting at index with data. [...]
setCustomRules(List<Rule> customRules) → void
toDelta() Delta
Returns contents of this document as Delta.
toPlainText() String
Returns plain text representation of this document.
toString() String
A string representation of this object. [...]
undo() Tuple2


operator ==(Object other) bool
The equality operator. [...]