bindScroll method

void bindScroll(
  1. VoidCallback listener
)

Subscribes listener to the scrollable's CURRENT position and keeps the subscription glued to it. ScrollableState swaps its ScrollPosition whenever the physics runtimeType changes (_shouldUpdatePosition, applied by _updatePosition, in scrollable.dart), so the identity is re-checked on every sample and on every syncScrollSubscription call; a listener left on the dead position would never fire again. unbindScroll detaches.

Implementation

void bindScroll(VoidCallback listener) {
  _scrollListener = listener;
  syncScrollSubscription();
}