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.

Properties

hashCode int
The hash code for this object.
no setterinherited
offset double
The current scroll offset of the group.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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, {required Curve curve, required 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 nonexistent 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