dice method

dynamic dice(
  1. TreeNodeBase node,
  2. double left,
  3. double top,
  4. double right,
  5. double bottom
)

Implementation

dice(
    TreeNodeBase node, double left, double top, double right, double bottom) {
  var k = (right - left) / node.value!;

  for (var child in node.children!) {
    child.left = left;
    child.top = top;
    child.right = left += child.value * k;
    child.bottom = bottom;
  }
}