ParchmentDocument class
A rich text document.
Constructors
- ParchmentDocument.new({ParchmentHeuristics heuristics = ParchmentHeuristics.fallback})
- Creates new empty Parchment document.
- ParchmentDocument.fromDelta(Delta delta, {ParchmentHeuristics heuristics = ParchmentHeuristics.fallback})
-
Creates new ParchmentDocument from provided
delta
. - ParchmentDocument.fromJson(List data, {ParchmentHeuristics heuristics = ParchmentHeuristics.fallback})
-
Creates new ParchmentDocument from provided JSON
data
.
Properties
-
changes
→ Stream<
ParchmentChange> -
Stream of ParchmentChanges applied to this document.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- 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) → ParchmentStyle - 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 atindex
. -
format(
int index, int length, ParchmentAttribute attribute) → Delta -
Formats segment of this document with specified
attribute
. -
insert(
int index, Object data) → Delta -
Inserts
data
in this document at specifiedindex
. -
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 atindex
withdata
. -
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