loopOverChildren method

void loopOverChildren(
  1. void callback(
    1. RenderBox child,
    2. int childIndex
    ), [
  2. bool? reversed
])

Implementation

void loopOverChildren(
  void Function(RenderBox child, int childIndex) callback, [
  bool? reversed,
]) {
  final isReversed = reversed ?? textDirection == TextDirection.rtl;
  var child = isReversed ? lastChild : firstChild;
  var childIndex = isReversed ? childCount - 1 : 0;

  while (child != null) {
    callback(child, childIndex);

    final childParentData = child.parentData as _BreadcrumbChild;
    if (isReversed) {
      child = childParentData.previousSibling;
      childIndex--;
    } else {
      child = childParentData.nextSibling;
      childIndex++;
    }
  }
}