defaultComputeDistanceToHighestActualBaseline method

double defaultComputeDistanceToHighestActualBaseline (TextBaseline baseline)

Returns the minimum baseline value among every child.

Useful when the vertical position of the children isn't determined by the order in the child list.


double defaultComputeDistanceToHighestActualBaseline(TextBaseline baseline) {
  double result;
  ChildType child = firstChild;
  while (child != null) {
    final ParentDataType childParentData = child.parentData;
    double candidate = child.getDistanceToActualBaseline(baseline);
    if (candidate != null) {
      candidate += childParentData.offset.dy;
      if (result != null)
        result = math.min(result, candidate);
        result = candidate;
    child = childParentData.nextSibling;
  return result;