animateToBefore method
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);
}