ViewportOffset class

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:

Inheritance
Implemented by

Constructors

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

Properties

pixels double
The number of pixels to offset the children in the opposite of the axis direction. [...]
read-only
userScrollDirection ScrollDirection
The direction in which the user is trying to change pixels, relative to the viewport's RenderViewport.axisDirection. [...]
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
hasListeners bool
Whether any listeners are currently registered. [...]
@protected, read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

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. [...]
@mustCallSuper
jumpTo(double pixels) → void
Jumps the scroll position from its current value to the given value, without animation, and without checking if the new value is in range.
toString() String
Returns a string representation of this object.
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes. [...]
inherited
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 and removeListener will throw after the object is disposed). [...]
@mustCallSuper, inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
notifyListeners() → void
Call all the registered listeners. [...]
@protected, inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes. [...]
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited