animateToBefore method

Future<void> animateToBefore({
  1. required Duration duration,
  2. required Curve curve,
})

This function is to scroll to before id with animation.

Implementation

Future<void> animateToBefore(
    {required Duration duration, required Curve curve}) async {
  Function _function = (double offset) {
    scrollController!.animateTo(offset, duration: duration, curve: curve);
  };
  _scroll(id: _getNextId(number: -1), scrollFunction: _function);
}