scrollToTop method

Future<void> scrollToTop()

The method for the scroll to top.

Implementation

Future<void> scrollToTop() async {
  if (controller.hasClients) {
    if (controller.offset > 0) {
      await controller.animateTo(
        0,
        duration: Duration(milliseconds: animationDurationInMilliseconds),
        curve: Curves.easeOut,
      );
    }
  }
}