copyWith<T extends RenderBoxModel> method

T copyWith<T extends RenderBoxModel>(
  1. T copiedRenderBoxModel
)

Implementation

T copyWith<T extends RenderBoxModel>(T copiedRenderBoxModel) {
  if (renderPositionPlaceholder != null) {
    renderPositionPlaceholder!.positioned = copiedRenderBoxModel;
  }

  scrollOffsetX?.removeListener(scrollXListener);
  scrollOffsetY?.removeListener(scrollYListener);

  RenderIntersectionObserverMixin.copyTo(this, copiedRenderBoxModel);

  return copiedRenderBoxModel
  // Copy render style
    ..renderStyle = renderStyle

  // Copy box decoration
    ..boxPainter = boxPainter

  // Copy overflow
    ..scrollListener = scrollListener
    ..scrollablePointerListener = scrollablePointerListener
    ..scrollOffsetX = scrollOffsetX
    ..scrollOffsetY = scrollOffsetY

  // Copy event hook
    ..getEventTarget = getEventTarget

  // Copy renderPositionHolder
    ..renderPositionPlaceholder = renderPositionPlaceholder

  // Copy parentData
    ..parentData = parentData;
}