scrollByOffset method
Scrolls the ScrollController by the given offset (smooth scroll).
offset is the value to add to the current scroll position (can be positive or negative).
duration specifies the duration of the scroll animation.
curve defines the curve for the animation (defaults to Curves.easeInOut).
Implementation
Future<void> scrollByOffset(
double offset, {
Duration duration = const Duration(milliseconds: 300),
Curve curve = Curves.easeInOut,
}) {
return animateTo(
position.pixels + offset,
duration: duration,
curve: curve,
);
}