rebuild method

void rebuild()

Notify listeners that the tree structure changed in some way.

Call this method whenever the tree nodes are updated (i.e., expansion state changed, node added/removed/reordered, etc...), so that listeners may handle the updated values. Most methods of this controller (like expand, collapse, etc.) already call rebuild implicitly.

Example:

class Node {
  List<Node> children;
}

TreeController<Node> controller = ...;

void addChildren(Node parent, Iterable<Node> children) {
  parent.children.addAll(children);
  controller.rebuild();
}

Implementation

void rebuild() => notifyListeners();