forEachChild method

void forEachChild(
  1. void callback(
    1. BoxConstraints constraints,
    2. Size size,
    3. OffsetWrapper offset,
    4. int childIndex,
    )
)

Implementation

void forEachChild(
    void Function(BoxConstraints constraints, Size size,
            OffsetWrapper offset, int childIndex)
        callback) {
  assert(
      childrenSizes.length == childrenParentData.length,
      "Do not add or remove items to/from the childrenSizes and "
      "childrenParentData lists.");
  for (int i = 0, j = 0;
      i < childrenSizes.length && j < childrenParentData.length;
      i++, j++) {
    callback(constraints, childrenSizes[i],
        OffsetWrapper(childrenParentData[i]), i); // i should be equals to j
  }
}