Document class
The rich text document
Constructors
- 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
.
Properties
-
changes
→ Stream<
DocChange> -
Stream of DocChanges applied to this document.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasRedo → bool
-
no setter
- hasUndo → bool
-
no setter
- length → int
-
Length of this document.
no setter
- root → Root
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → void -
collectAllIndividualStyles(
int index, int len) → List< OffsetValue< 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 specifiedindex
. -
isEmpty(
) → bool -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
queryChild(
int offset) → ChildQuery -
Returns Line located at specified character
offset
. -
querySegmentLeafNode(
int offset) → SegmentLeafNode - Given offset, find its leaf node in document
-
redo(
) → HistoryChanged -
replace(
int index, int len, Object? data) → Delta -
Replaces length of characters starting at
index
withdata
. -
search(
Pattern other) → List< int> - Search the whole document for any substring matching the pattern Returns the offsets that matches the pattern
-
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.
inherited
-
undo(
) → HistoryChanged
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited