BsScrollspyController class
A controller for the BsScrollspy component.
The controller manages the currently active target ID and handles smooth scrolling to the registered target sections.
- Inheritance
-
- Object
- ChangeNotifier
- BsScrollspyController
Constructors
- BsScrollspyController({ScrollController? scrollController})
- Creates a BsScrollspyController.
Properties
- activeTargetId → String?
-
The ID of the currently active target section.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollController → ScrollController
-
The underlying ScrollController used by the scrollable area.
final
-
targets
→ Map<
String, GlobalKey< State< >StatefulWidget> > -
Returns an unmodifiable map of registered targets and their keys.
no setter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
registerTarget(
String id, GlobalKey< State< key) → voidStatefulWidget> > -
Registers a target section with the given
idandkey. -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
scrollToTarget(
String id, {bool smooth = true}) → Future< void> -
Scrolls to the target section with the given
id. -
setActiveTarget(
String id) → void - Updates the currently active target ID and notifies listeners if it changed.
-
toString(
) → String -
A string representation of this object.
inherited
-
unregisterTarget(
String id) → void -
Unregisters the target section with the given
id.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited