ScrollControllerExtension extension

An extension for ScrollController.

on

Methods

checkAndDetach(ScrollPosition position) bool
Checks whether given ScrollPosition has been attached, and detaches it.
isScrollOver(double threshold, {double maxScrollExtentError = 1.0}) bool
Checks whether current scroll offset is larger than given threshold, or is in the bottom of scroll view.
scrollLess({double scrollOffset = _kDefaultScrollOffset, Curve curve = _kShortScrollAnimationCurve, Duration duration = _kShortScrollAnimationDuration}) Future<void>
Scrolls less (or said, scroll up or swipe down) from the current position with scrollOffset, see scrollWithAnimate.
scrollMore({double scrollOffset = _kDefaultScrollOffset, Curve curve = _kShortScrollAnimationCurve, Duration duration = _kShortScrollAnimationDuration}) Future<void>
Scrolls more, (or said, scroll down or swipe up) from the current position with scrollOffset, see scrollWithAnimate.
scrollToBottom({Curve curve = _kScrollAnimationCurve, Duration duration = _kScrollAnimationDuration}) Future<void>
Scrolls to the bottom of the scroll view, see scrollWithAnimate, note that you may need to use SchedulerBinding.addPostFrameCallback to perform the operation.
scrollToTop({Curve curve = _kScrollAnimationCurve, Duration duration = _kScrollAnimationDuration}) Future<void>
Scrolls to the top of the scroll view, see scrollWithAnimate.
scrollWithAnimate(double offset, {Curve curve = _kScrollAnimationCurve, Duration duration = _kScrollAnimationDuration}) Future<void>
Scrolls to given offset with default Curve and Duration.