defaultComputeDistanceToFirstActualBaseline method

double? defaultComputeDistanceToFirstActualBaseline(
  1. TextBaseline baseline

Returns the baseline of the first child with a baseline.

Useful when the children are displayed vertically in the same order they appear in the child list.


double? defaultComputeDistanceToFirstActualBaseline(TextBaseline baseline) {
  ChildType? child = firstChild;
  while (child != null) {
    final ParentDataType childParentData = child.parentData! as ParentDataType;
    final double? result = child.getDistanceToActualBaseline(baseline);
    if (result != null) {
      return result + childParentData.offset.dy;
    child = childParentData.nextSibling;
  return null;