ListenableNode class
- Inheritance
- Implemented types
- Mixed-in types
- Implementers
Constructors
- ListenableNode({String? key, Node? parent})
- A listenable implementation the Node. The mutations to the Node can be listened to using the ValueListenable interface or the addedNodes and removedNodes streams.
- ListenableNode.root()
-
Alternate factory constructor for ListenableNode that should be used for
the root nodes.
factory
Properties
-
addedNodes
→ Stream<
NodeAddEvent< INode> > -
Listen to this Stream to get updates on when a Node or a collection of
Nodes is added to the current node.
no setteroverride
-
children
→ Map<
String, Node> -
These are the children of the node.
finalinherited
-
childrenAsList
→ List<
ListenableNode> -
This returns the children as an iterable list.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
-
insertedNodes
→ Stream<
NodeInsertEvent< INode> > -
The insertNodes stream is not allowed for the ListenableNode.
The index based operations like 'insert' are not implemented in ListenableNode
no setteroverride
- isLeaf → bool
-
Getter to check if the node is a Leaf.
A Leaf-Node does have any children.
no setterinherited
- isRoot → bool
-
Getter to check if the node is a root.
Root is always the first node in a Tree. A Root-Node never has a parent.
no setterinherited
- key → String
-
This is the uniqueKey of the Node
finalinherited
- length → int
-
Getter to get the total number of children
no setterinherited
- level → int
-
Getter to get the level i.e. how many iterations it will take to get to the
root.
** Note: starting index is 0.
no setterinherited
-
meta
↔ Map<
String, dynamic> ? -
Any related data that needs to be accessible from the node can be added to
meta without needing to extend or implement the INode
getter/setter pairinherited
- parent ↔ ListenableNode?
-
This is the parent ListenableNode. Only the root node has a null parent
covariantgetter/setter pairoverride
- path → String
-
Path of the node in the tree. It provides information about the node
hierarchy by listing all the ancestors of the node.
no setterinherited
-
removedNodes
→ Stream<
NodeRemoveEvent< INode> > -
Listen to this Stream to get updates on when a Node or a collection of
Nodes is removed from the current node.
no setteroverride
- root → ListenableNode
-
Getter to get the root node.
If the current node is not a root, then the getter will traverse up the
path to get the root.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → ListenableNode
-
Getter to get the value of the ValueListenable. It returns the root
no setteroverride
Methods
-
add(
covariant Node value) → void -
Add a
value
node to the childrenoverride -
addAll(
covariant Iterable< Node> iterable) → void -
Add a collection of Iterable nodes to
this
nodeoverride -
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
clear(
) → void -
Clear all the child nodes from children. The children will be empty
after this operation.
override
-
delete(
) → void -
Delete
this
nodeoverride -
dispose(
) → void -
Disposer to clear the listeners and StreamSubscriptions
override
-
elementAt(
String path) → ListenableNode -
- Utility method to get a child node at the
path
. Get any item atpath
from the root The keys of the items to be traversed should be provided in thepath
override - Utility method to get a child node at the
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
remove(
covariant Node value) → void -
Remove a child
value
node from the childrenoverride -
removeAll(
covariant Iterable< Node> iterable) → void -
Remove all the Iterable nodes from the children
override
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
removeWhere(
bool test(Node element)) → void -
Remove all the child nodes from the children that match the criterion in
the provided
test
override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
String path) → ListenableNode -
Overloaded operator for elementAt
override