elementAt abstract method

INode elementAt(
  1. String path
)
  • 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

For example in a TreeView like this

Node get mockNode1 => Node.root()
  ..addAll([
    Node(key: "0A")..add(Node(key: "0A1A")),
    Node(key: "0B"),
    Node(key: "0C")
      ..addAll([
        Node(key: "0C1A"),
        Node(key: "0C1B"),
        Node(key: "0C1C")
          ..addAll([
            Node(key: "0C1C2A")
              ..addAll([
                Node(key: "0C1C2A3A"),
                Node(key: "0C1C2A3B"),
                Node(key: "0C1C2A3C"),
              ]),
          ]),
      ]),
  ]);

In order to access the Node with key "0C1C", the path would be 0C.0C1C

Note: The root node ROOT_KEY does not need to be in the path

Implementation

INode elementAt(String path);