jumpToBottom method

Future<void> jumpToBottom()

The method for the jump to bottom.

Implementation

Future<void> jumpToBottom() async {
  if (controller.hasClients) {
    while (controller.offset + 1 < controller.position.maxScrollExtent) {
      Logger().i(
          '[easy-chat-scroll-controller] jumpToBottom offset: ${controller.offset}, maxScrollExtent: ${controller.position.maxScrollExtent}');
      controller.jumpTo(
        controller.position.maxScrollExtent,
      );
      await Future.delayed(
        Duration(milliseconds: animationDurationInMilliseconds),
      );
    }
  }
}