ScrollControllerX extension

Position queries and scroll shortcuts on ScrollController.

Every member checks ScrollController.hasClients first. Reading controller.position before the controller is attached throws, and that is the single most common bug with scroll controllers — build order and disposal both leave you briefly detached.

on

Properties

isAtBottom → bool

Available on ScrollController, provided by the ScrollControllerX extension

Whether the view is scrolled to (or past) the bottom.
no setter
isAtTop → bool

Available on ScrollController, provided by the ScrollControllerX extension

Whether the view is scrolled to (or past) the top.
no setter
isScrollable → bool

Available on ScrollController, provided by the ScrollControllerX extension

Whether there is anything to scroll.
no setter
isScrollingDown → bool

Available on ScrollController, provided by the ScrollControllerX extension

Whether the user is currently dragging the content upward (revealing later items). false when not attached or idle.
no setter
isScrollingUp → bool

Available on ScrollController, provided by the ScrollControllerX extension

Whether the user is currently dragging the content downward.
no setter
maxScroll → double

Available on ScrollController, provided by the ScrollControllerX extension

Maximum scrollable extent, or 0 when not attached.
no setter
minScroll → double

Available on ScrollController, provided by the ScrollControllerX extension

Minimum scrollable extent, or 0 when not attached.
no setter
offsetOrZero → double

Available on ScrollController, provided by the ScrollControllerX extension

Current offset, or 0 when not attached.
no setter
progress → double

Available on ScrollController, provided by the ScrollControllerX extension

Scroll progress in [0, 1], or 0 when not attached or not scrollable.
no setter

Methods

animateToBottom({Duration duration = const Duration(milliseconds: 300), Curve curve = Curves.easeOut}) → Future<void>

Available on ScrollController, provided by the ScrollControllerX extension

Animates to the bottom. No-op when not attached.
animateToTop({Duration duration = const Duration(milliseconds: 300), Curve curve = Curves.easeOut}) → Future<void>

Available on ScrollController, provided by the ScrollControllerX extension

Animates to the top. No-op when not attached.
isNearBottom({double tolerance = 200}) → bool

Available on ScrollController, provided by the ScrollControllerX extension

Whether offset is within tolerance of the bottom.
isNearTop({double tolerance = 200}) → bool

Available on ScrollController, provided by the ScrollControllerX extension

Whether offset is within tolerance of the top.
jumpToBottom() → void

Available on ScrollController, provided by the ScrollControllerX extension

Jumps to the bottom without animating. No-op when not attached.
jumpToClamped(double target) → void

Available on ScrollController, provided by the ScrollControllerX extension

Jumps to target, clamped to the scrollable range. No-op when not attached.
jumpToTop() → void

Available on ScrollController, provided by the ScrollControllerX extension

Jumps to the top without animating. No-op when not attached.