updateRenderBoxModelWithOverflowY method

void updateRenderBoxModelWithOverflowY(
  1. ScrollListener scrollListener
)

Implementation

void updateRenderBoxModelWithOverflowY(ScrollListener scrollListener) {
  if (renderBoxModel is RenderSliverListLayout) {
    RenderSliverListLayout renderBoxModel = this.renderBoxModel as RenderSliverListLayout;
    renderBoxModel.scrollOffsetY = renderBoxModel.axis == Axis.vertical
        ? renderBoxModel.scrollable.position : null;
  } else if (renderBoxModel != null) {
    RenderBoxModel renderBoxModel = this.renderBoxModel!;
    CSSOverflowType overflowY = renderStyle.effectiveOverflowY;
    switch(overflowY) {
      case CSSOverflowType.hidden:
        // @TODO: Content of overflow hidden can be scrolled programmatically.
        _scrollableY = null;
        break;
      case CSSOverflowType.clip:
        _scrollableY = null;
        break;
      case CSSOverflowType.auto:
      case CSSOverflowType.scroll:
        _scrollableY = KrakenScrollable(axisDirection: AxisDirection.down, scrollListener: scrollListener);
        renderBoxModel.scrollOffsetY = _scrollableY!.position;
        break;
      case CSSOverflowType.visible:
      default:
        _scrollableY = null;
        break;
    }

    renderBoxModel.scrollListener = scrollListener;
    renderBoxModel.scrollablePointerListener = _scrollablePointerListener;
  }
}