ParagraphNode class
- Inheritance
-
- Object
- DocumentNode
- TextNode
- ParagraphNode
- Available extensions
Constructors
-
ParagraphNode({required String id, required AttributedText text, int indent = 0, Map<
String, dynamic> ? metadata})
Properties
- beginningPosition → TextNodePosition
-
Returns the NodePosition that corresponds to the beginning
of content in this node.
no setterinherited
- endPosition → TextNodePosition
-
Returns the NodePosition that corresponds to the end of the
content in this node.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setteroverride
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- id → String
-
ID that is unique within a Document.
finalinherited
- indent ↔ int
-
The indent level of this paragraph -
0
is no indent.getter/setter pair - isDeletable → bool
-
no setterinherited
-
metadata
↔ Map<
String, dynamic> -
Returns all metadata attached to this DocumentNode.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- text ↔ AttributedText
-
The content text within this TextNode.
getter/setter pairinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
computeSelection(
{required NodePosition base, required NodePosition extent}) → TextNodeSelection -
Returns a node-specific representation of a selection from
base
toextent
.inherited -
containsPosition(
Object position) → bool -
Returns
true
if this DocumentNode contains the givenposition
, orfalse
if theposition
doesn't sit within this node, or if theposition
type doesn't apply to this DocumentNode.inherited -
copy(
) → ParagraphNode -
override
-
copyContent(
dynamic selection) → String -
Returns a plain-text version of the content in this node
within
selection
, or null if the given selection does not make sense as plain-text.inherited -
copyMetadata(
) → Map< String, dynamic> -
Returns a copy of this node's metadata.
inherited
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
getAffinityBetween(
{required NodePosition base, required NodePosition extent}) → TextAffinity -
Available on DocumentNode, provided by the InspectNodeAffinity extension
Returns the affinity direction implied by the givenbase
andextent
. -
getMetadataValue(
String key) → dynamic -
Returns this node's metadata value for the given
key
.inherited -
hasEquivalentContent(
DocumentNode other) → bool -
Returns true if the
other
node is the same type as this node, and contains the same content.inherited -
hasMetadataValue(
String key) → bool -
Returns
true
if this node has a non-null metadata value for the given metadatakey
, and returnsfalse
, otherwise.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
positionAt(
int index) → DocumentPosition -
Returns a DocumentPosition within this TextNode at the given text
index
.inherited -
putMetadataValue(
String key, dynamic value) → void -
Sets this node's metadata value for the given
key
to the givenvalue
, and notifies node listeners that a change has occurred.inherited -
rangeBetween(
int startIndex, int endIndex) → DocumentRange -
Returns a DocumentRange within this TextNode between
startIndex
andendIndex
.inherited -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
selectDownstreamPosition(
NodePosition position1, NodePosition position2) → NodePosition -
Inspects
position1
andposition2
and returns the one that's positioned further downstream in this DocumentNode.inherited -
selectionAt(
int collapsedIndex) → DocumentSelection -
Returns a collapsed DocumentSelection, positioned within this TextNode at the
given
collapsedIndex
.inherited -
selectionBetween(
int startIndex, int endIndex) → DocumentSelection -
Returns a DocumentSelection within this TextNode from
startIndex
toendIndex
.inherited -
selectUpstreamPosition(
NodePosition position1, NodePosition position2) → NodePosition -
Inspects
position1
andposition2
and returns the one that's positioned further upstream in this DocumentNode.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override