setVerticalMargins method

void setVerticalMargins(
  1. int top,
  2. int bottom
)

Sets the vertical scrolling margin to top and bottom. Both values must be between 0 and viewHeight - 1.

Implementation

void setVerticalMargins(int top, int bottom) {
  _marginTop = top.clamp(0, viewHeight - 1);
  _marginBottom = bottom.clamp(0, viewHeight - 1);

  _marginTop = min(_marginTop, _marginBottom);
  _marginBottom = max(_marginTop, _marginBottom);
}