levelOf method

int levelOf (
  1. T node
)

Calculates the level of hierarchy of the node, taking into account the startingLevel. You can use this value to shift the widget's position right.

Implementation

int levelOf(T node) {
  assert(node != null);
  var level = includeRoot ? startingLevel : startingLevel - 1;
  for (var n = node; !isRootNode(n); n = parentOf(n)) {
    level++;
  }
  return level;
}