depth property

int depth

Return the depth of this node in its tree, a root node has depth 0.

Implementation

int get depth {
  var result = 0;
  for (var node = parent; node != null; node = node.parent) {
    result++;
  }
  return result;
}