tree method

void tree(
  1. Comp<T> node,
  2. num x,
  3. num y,
  4. num fontSize,
  5. String prefix,
  6. ColorD color, [
  7. List<int>? yRef,
])

Implementation

void tree(
  Comp<T> node,
  num x,
  num y,
  num fontSize,
  String prefix,
  ColorD color,
  [List<int>? yRef]
) {
  yRef ??= [y.toInt()];

  bool isLast = false;
  final parent = node.getParentAs<IsAnyComponentManagable<T>>();
  final comps = parent!.getComponents().toList();

  if (comps.indexOf(node) == comps.length - 1) {
    isLast = node.getComponents().isEmpty;
  }

  _drawComponentTree(node, x, y, fontSize, prefix, color, isLast, yRef);
}