LineNode class
A line of rich text in a Notus document.
LineNode serves as a container for LeafNodes, like TextNode and EmbedNode.
When a line contains an embed, it fully occupies the line, no other embeds or text nodes are allowed.
- Inheritance
-
- Object
- LinkedListEntry<
Node> - Node
- ContainerNode<
LeafNode?> - LineNode
- Implemented types
- Mixed-in types
Constructors
- LineNode()
Properties
- childCount → int
-
Returns total number of child nodes in this container.
no setterinherited
-
children
→ LinkedList<
Node> -
List of children.
no setterinherited
- defaultChild → LeafNode
-
Returns an instance of default child for this container node.
no setteroverride
- documentOffset → int
-
Offset in characters of this node in the document.
no setterinherited
- first → Node
-
Returns the first child Node.
no setterinherited
- hasEmbed → bool
-
Returns
true
if this line contains an embed.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Returns
true
if this container has no child nodes.no setterinherited - isFirst → bool
-
Returns
true
if this node is the first node in the parent list.no setterinherited - isLast → bool
-
Returns
true
if this node is the last node in the parent list.no setterinherited - isNotEmpty → bool
-
Returns
true
if this container has at least 1 child.no setterinherited - last → Node
-
Returns the last child Node.
no setterinherited
- length → int
-
Content length of this node's children. To get number of children in this
node use childCount.
no setteroverride
-
list
→ LinkedList<
Node> ? -
The linked list containing this element.
no setterinherited
- mounted → bool
-
Returns
true
if this node is currently mounted, e.g. parent is notnull
.no setterinherited - next → Node?
-
The successor of this element in its linked list.
no setterinherited
- nextLine → LineNode?
-
Returns next LineNode or
null
if this is the last line in the document.no setter - offset → int
-
Offset in characters of this node relative to parent node.
no setterinherited
-
parent
→ ContainerNode<
Node?> ? -
Current parent of this node. May be null if this node is not mounted.
no setterinherited
- previous → Node?
-
The predecessor of this element in its linked list.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- style → NotusStyle
-
Style of this node.
no setterinherited
Methods
-
add(
LeafNode? node) → void -
Adds
node
to the end of this container children list.inherited -
addFirst(
LeafNode? node) → void -
Adds
node
to the beginning of this container children list.inherited -
applyAttribute(
NotusAttribute attribute) → void -
Applies style
attribute
to this node.inherited -
applyStyle(
NotusStyle value) → void -
Applies new style
value
to this node. Providedvalue
is merged into current style.inherited -
clearStyle(
) → void -
Clears style of this node.
inherited
-
clone(
) → LineNode - Creates new empty LineNode with the same style.
-
collectStyle(
int offset, int length) → NotusStyle - Returns style for specified text range.
-
containsOffset(
int offset) → bool -
Returns
true
if this node contains character at specifiedoffset
in the document.inherited -
delete(
int index, int? length) → void -
Delete
length
characters of this node starting fromindex
.override -
insert(
int index, String text, NotusStyle? style) → void -
Insert
text
at specified characterindex
with stylestyle
.override -
insertAfter(
Node entry) → void -
Insert an element after this element in this element's linked list.
inherited
-
insertBefore(
Node entry) → void -
Insert an element before this element in this element's linked list.
inherited
-
lookup(
int offset, {bool inclusive = false}) → LookupResult -
Looks up a child Node at specified character
offset
in this container.inherited -
moveChildren(
ContainerNode< Node?> ? newParent) → void -
Moves children of this node to
newParent
.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
optimize(
) → void -
Optimize this node within parent.
override
-
remove(
LeafNode? node) → void -
Removes
node
from this container.inherited -
retain(
int index, int? length, NotusStyle? style) → void -
Format
length
characters of this node starting fromindex
with specified stylestyle
.override -
splitAt(
int index) → LineNode -
Splits this line into two at specified character
index
. -
toDelta(
) → Delta -
Returns Delta representation of this node.
override
-
toPlainText(
) → String -
Returns plain-text representation of this node.
override
-
toString(
) → String -
A string representation of this object.
override
-
unlink(
) → void -
Unlink the element from its linked list.
inherited
-
unwrap(
) → void - Unwraps this line from it's parent BlockNode.
-
wrap(
BlockNode block) → void -
Wraps this line with new parent
block
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited