NotusDocument class

A rich text document.

Constructors

NotusDocument({NotusHeuristics heuristics = NotusHeuristics.fallback})
Creates new empty Notus document.
NotusDocument.fromDelta(Delta delta, {NotusHeuristics heuristics = NotusHeuristics.fallback})
Creates new NotusDocument from provided delta.
NotusDocument.fromJson(List data, {NotusHeuristics heuristics = NotusHeuristics.fallback})
Creates new NotusDocument from provided JSON data.

Properties

changes Stream<NotusChange>
Stream of NotusChanges applied to this document.
no setter
hashCode int
The hash code for this object.
no setterinherited
heuristics NotusHeuristics
final
isClosed bool
Returns true if this document and associated stream of changes is closed.
no setter
length int
Length of this document.
no setter
root RootNode
The root node of this document tree.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → void
Closes changes stream.
collectStyle(int index, int length) NotusStyle
Returns style of specified text range.
compose(Delta change, ChangeSource source) → void
Composes change Delta into this document.
delete(int index, int length) → Delta
Deletes length of characters from this document starting at index.
format(int index, int length, NotusAttribute attribute) → Delta
Formats segment of this document with specified attribute.
insert(int index, Object data) → Delta
Inserts data in this document at specified index.
lookupLine(int offset) LookupResult
Returns LineNode located at specified character offset.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
replace(int index, int length, Object data) → Delta
Replaces length of characters starting at index with data.
toDelta() → Delta
Returns contents of this document as Delta.
toJson() → dynamic
toPlainText() String
Returns plain text representation of this document.
toString() String
A string representation of this object.
override

Operators

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