setContentHeight method

bool setContentHeight(
  1. int height
)

Updates the content height and clamps offset if needed.

Implementation

bool setContentHeight(int height) {
  if (height < 0) height = 0;
  if (_contentHeight == height) return false;
  final beforeHeight = _contentHeight;
  final beforeOffset = _offset;
  _contentHeight = height;
  final clamped = _clampOffset();
  _traceScroll(
    'list_view.metrics.content '
    'content=$beforeHeight->$_contentHeight '
    'offset=$beforeOffset->$_offset max=$maxOffset clamped=$clamped',
  );
  return clamped;
}