updateChildLayoutOffset method

  1. @override
void updateChildLayoutOffset(
  1. RenderSliver child,
  2. double layoutOffset,
  3. GrowthDirection growthDirection
)
override

Called during layoutChildSequence to store the layout offset for the given child.

Different subclasses using different representations for their children's layout offset (e.g., logical or physical coordinates). This function lets subclasses transform the child's layout offset before storing it in the child's parent data.

Implementation

@override
void updateChildLayoutOffset(RenderSliver child, double layoutOffset, GrowthDirection growthDirection) {
  assert(growthDirection == GrowthDirection.forward);
  final SliverLogicalParentData childParentData = child.parentData! as SliverLogicalParentData;
  childParentData.layoutOffset = layoutOffset;
}