scrollsExtreme function

void scrollsExtreme({
  1. required ScrollController scrollController,
  2. bool scrollToTop = false,
})

scrolls to extreme top or bottom using ScrollController

Implementation

void scrollsExtreme({
  required ScrollController scrollController,
  bool scrollToTop = false,
}) {
  scrollController.animateTo(
    scrollToTop == true
        ? scrollController.position.minScrollExtent
        : scrollController.position.maxScrollExtent,
    duration: const Duration(milliseconds: 500),
    curve: Curves.easeInOut,
  );
}