ViewportOffset class abstract

Which part of the content inside the viewport should be visible.

The pixels value determines the scroll offset that the viewport uses to select which part of its content to display. As the user scrolls the viewport, this value changes, which changes the content that is displayed.

This object is a Listenable that notifies its listeners when pixels changes.

See also:



Default constructor.
ViewportOffset.fixed(double value)
Creates a viewport offset with the given pixels value.
Creates a viewport offset with a pixels value of 0.0.


allowImplicitScrolling bool
Whether a viewport is allowed to change pixels implicitly to respond to a call to RenderObject.showOnScreen.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
hasPixels bool
Whether the pixels property is available.
no setter
pixels double
The number of pixels to offset the children in the opposite of the axis direction.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
userScrollDirection ScrollDirection
The direction in which the user is trying to change pixels, relative to the viewport's RenderViewportBase.axisDirection.
no setter


addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
animateTo(double to, {required Duration duration, required Curve curve}) Future<void>
Animates pixels from its current value to the given value.
applyContentDimensions(double minScrollExtent, double maxScrollExtent) bool
Called when the viewport's content extents are established.
applyViewportDimension(double viewportDimension) bool
Called when the viewport's extents are established.
correctBy(double correction) → void
Apply a layout-time correction to the scroll offset.
debugFillDescription(List<String> description) → void
Add additional information to the given description for use by toString.
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
jumpTo(double pixels) → void
Jumps pixels from its current value to the given value, without animation, and without checking if the new value is in range.
moveTo(double to, {Duration? duration, Curve? curve, bool? clamp}) Future<void>
Calls jumpTo if duration is null or, otherwise animateTo is called.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
notifyListeners() → void
Call all the registered listeners.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
toString() String
A string representation of this object.


operator ==(Object other) bool
The equality operator.