getChildScrollOffset method

Offset getChildScrollOffset(
  1. RenderObject child,
  2. Offset offset
)

Implementation

Offset getChildScrollOffset(RenderObject child, Offset offset) {
  final RenderLayoutParentData? childParentData =
      child.parentData as RenderLayoutParentData?;
  bool isChildFixed = child is RenderBoxModel
      ? child.renderStyle.position == CSSPositionType.fixed
      : false;
  // Fixed elements always paint original offset
  Offset scrollOffset = isChildFixed
      ? childParentData!.offset
      : childParentData!.offset + offset;
  return scrollOffset;
}