LinkedScrollControllerGroup class

Sets up a collection of scroll controllers that mirror their movements to each other.

Controllers are added and returned via addAndGet. The initial offset of the newly created controller is synced to the current offset. Controllers must be disposed when no longer in use to prevent memory leaks and performance degradation.

If controllers are disposed over the course of the lifetime of this object the corresponding scrollables should be given unique keys. Without the keys, Flutter may reuse a controller after it has been disposed, which can cause the controller offsets to fall out of sync.

Constructors

LinkedScrollControllerGroup()

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
offset double
The current scroll offset of the group.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

addAndGet() ScrollController
Creates a new controller that is linked to any existing ones.
addOffsetChangedListener(VoidCallback onChanged) → void
Adds a callback that will be called when the value of offset changes.
animateTo(double offset, {Curve curve, Duration duration}) Future<void>
Animates the scroll position of all linked controllers to offset.
jumpTo(double value) → void
Jumps the scroll position of all linked controllers to value.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
removeOffsetChangedListener(VoidCallback listener) → void
Removes the specified offset changed listener.
resetScroll() → void
Resets the scroll position of all linked controllers to 0.
toString() String
A string representation of this object. [...]
inherited

Operators

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