2

this is definitely similar to Flutter - ListView.builder: Initial scroll position but it seems there is no solution to it.

I know I can set the initial offset to a double, but what I want is the controller.position.maxScrollExtent.

this is for a chat page, how can WhatsApp and other apps so it so easy while we have to do workarounds for this simple thing?

This will not work > _chatScrollController = ScrollController(initialScrollOffset: _chatScrollController.position.maxScrollExtent); because the controller just initialized and it doesn't know the max offset yet. So what I ended up having to do, was to use animateTo after the chat was rebuilt. But I don't like this much. Is there a better way?

fenchai
  • 518
  • 1
  • 7
  • 21
  • Hi. Check and try my answer here: https://stackoverflow.com/questions/61034585/flutter-listview-scroll-to-bottom-on-build/61036037#61036037. See the UPDATE part. If it works for you, I make an answer in this question. – encubos Apr 07 '20 at 01:16
  • yeah this is what I am currently doing... although this is also the same as adding a function after the listview builds. I don't like this kind of workaround. – fenchai Apr 07 '20 at 06:25

0 Answers0