-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new message chat content not scroll to latest #53
Comments
This happen when the list view content's height exceed visible rect. |
how to solve |
You can use the method final scrollController = _chatViewKey.currentState.scrollController;
scrollController.animateTo(
scrollController.position.maxScrollExtent,
curve: Curves.easeOut,
duration: Duration(milliseconds: 300),
); Don't forget to define the GlobalKey ( final _chatViewKey = GlobalKey<DashChatState>();
// ... and on build method
return DashChat(
key: _chatViewKey,
); |
This doesn't actually solve the problem as well too. Not sure what's going on. It seems that with the visibility of the virtual keyboard, the new message is not going to it by default. One thing I tried was to increase my delay time before triggering the scrolling duration. That seems to be helpful in a lot more cases, but that didn't exactly fix it either. |
Also, if there are lots of images, which will render lazily, the messageListView will not scroll to latest message. |
same issue on 1.1.5 |
one solution to this is to set inverse: true. But then you have to get the messages in ascending order and do some custom logic. |
Any news? |
I think it makes sense to add a parameter to the DashChat constuctor enabling that behavior, it looks like a very common use case. |
Hi all, |
Hi @fluttercid, in that case you maybe have a margin issue, you can use |
Thank you for your answer @SebastienBtr |
i'm facing the same scroll issue in different scenario, whenever i try to open the dashchat or send a new message it stops before 1 or 2 recent messages, it's not fully scroll to bottom. This issue is happening for the scroll to bottom default button too. i'm using below line of codes to scroll.
Thanks in advance |
I am also facing @SubashManian 's issue. Is there any hacky way to fix it?? And is there any documentation for how internals of this package works. I could help out maybe. |
One workaround is to use a small delay after sending message and then scroll await Future.delayed(Duration(milliseconds: 500));
_chatViewKey.currentState.scrollController.animateTo(
_chatViewKey.currentState.scrollController.position.maxScrollExtent,
curve: Curves.easeOut,
duration: const Duration(milliseconds: 100),
); |
Describe the bug
when have new message chatbox content not scroll to latest is freezing
The text was updated successfully, but these errors were encountered: