scrollToBottom method

Future<void> scrollToBottom({
  1. Duration duration = const Duration(milliseconds: 300),
  2. Curve curve = Curves.ease,
})

Scrolls to the bottom of the list

Implementation

Future<void> scrollToBottom({
  Duration duration = const Duration(milliseconds: 300),
  Curve curve = Curves.ease,
}) async {
  if (!isAttached || _isDisposed) return;

  try {
    await _scrollController!.animateTo(
      _scrollController!.position.maxScrollExtent,
      duration: duration,
      curve: curve,
    );
  } catch (e, stackTrace) {
    _callbacks?.onError?.call('Failed to scroll to bottom of list $_listIndex: $e', stackTrace);
  }
}