animateScroll method

Future<void> animateScroll({
  1. required double offset,
  2. required Duration duration,
  3. Curve curve = Curves.linear,
})

Implementation

Future<void> animateScroll({required double offset,
  required Duration duration,
  Curve curve = Curves.linear}) async {
  final currentPosition =
      _scrollableListState!.primary.scrollController.offset;
  final newPosition = currentPosition + offset;
  await _scrollableListState!.primary.scrollController.animateTo(
    newPosition,
    duration: duration,
    curve: curve,
  );
}