depth property

int get depth

Current depth from the tree root.

Implementation

int get depth {
  var depth = 0;
  var current = parent;
  while (current != null) {
    depth++;
    current = current.parent;
  }
  return depth;
}