correctBy method

  1. @override
void correctBy (double correction)
override

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:

Implementation

@override
void correctBy(double correction) {
  assert(
    _pixels != null,
    'An initial pixels value must exist by caling correctPixels on the ScrollPosition',
  );
  _pixels += correction;
  _didChangeViewportDimensionOrReceiveCorrection = true;
}