correctBy method

  1. @override
void correctBy(
  1. double correction

Apply a layout-time correction to the scroll offset.

This method should change the pixels value by correction, but without calling notifyListeners. It is called during layout by the RenderViewport, before applyContentDimensions. After this method is called, the layout will be recomputed and that may result in this method being called again, though this should be very rare.

See also:


void correctBy(double correction) {
    'An initial pixels value must exist by calling correctPixels on the ScrollPosition',
  _pixels = _pixels! + correction;
  _didChangeViewportDimensionOrReceiveCorrection = true;