IListenableNode<T extends INode> class abstract

The base class for implementing a Listenable Node. It allows for the listener to observe any changes in the Node.

The IListenableNode also implements the ValueListenable, so it can be used with a ValueListenableBuilder for updating the UI whenever the node is mutated.

Inheritance
Implemented types
Implementers

Constructors

IListenableNode()

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. It returns a stream of NodeAddEvent
no setterinherited
children Object?
These are the children of the node. It is a collection that can be any appropriate data-structure like List or Map
no setterinherited
childrenAsList List<INode>
This returns the children as an iterable list. Since children can be implemented using any suitable data-structure, therefore by having an iterable list as children ensures that the children can always be iterated when required.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
insertedNodes Stream<NodeInsertEvent<INode>>
Listen to this Stream to get updates on when a Node or a collection of Nodes is inserted in the current node. It returns a stream of insertedNodes
no setterinherited
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 that every node needs to implement
no setterinherited
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 INode?
This is the parent INode. Only the root node has a null parent
covariantgetter/setter pairinherited
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. It returns a stream of NodeRemoveEvent
no setterinherited
root INode
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 setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → T
The current value of the object. When the value changes, the callbacks registered with addListener will be invoked.
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object notifies its listeners.
inherited
dispose() → void
inherited
elementAt(String path) INode
  • Utility method to get a child node at the path. Get any item at path from the root The keys of the items to be traversed should be provided in the path
  • inherited
    noSuchMethod(Invocation invocation) → dynamic
    Invoked when a nonexistent method or property is accessed.
    inherited
    removeListener(VoidCallback listener) → void
    Remove a previously registered closure from the list of closures that the object notifies.
    inherited
    toString() String
    A string representation of this object.
    inherited

    Operators

    operator ==(Object other) bool
    The equality operator.
    inherited
    operator [](String path) INode
    Overloaded operator for elementAt
    inherited