0

It seems Controller.position.maxScrollExtent is a predicted value since the bottom items haven't been rendered,Controller.jumpTo(Controller.position.maxScrollExtent)) can not work.

Henson Fang
  • 1,177
  • 7
  • 30
  • Does this answer your question? [Programmatically scrolling to the end of a ListView](https://stackoverflow.com/questions/43485529/programmatically-scrolling-to-the-end-of-a-listview) – Md. Yeasin Sheikh May 06 '22 at 16:28

1 Answers1

0
ScrollController _controller = ScrollController();

void jumpTo() {
  SchedulerBinding.instance!.addPostFrameCallback((_) {
    if (_controller.hasClients) {
      _controller.animateTo(
        _controller.position.maxScrollExtent,
        duration: const Duration(milliseconds: 100),
        curve: Curves.elasticInOut,
      );
    }
  });
}

Assign this _controller to Listview controller

and call jumpTo()

rasityilmaz
  • 764
  • 1
  • 6
  • 11