Comments (8)
When new message is sent, chat will be scrolled to the bottom. This is how Telegram and Facebook Messenger work and there is no reason to do it differently. One problem is that I did it on message received event and forgot that it actually might be incoming message, not sent one, will fix that ASAP.
from flutter_chat_ui.
Fixed in v1.1.2.
from flutter_chat_ui.
@demchenkoalex I think this issue might have been misunderstood, since the experience now is worse than before.
Looks like now every time that I get a message, the chat scrolls down to the bottom. So on an active chat, there is no way for me to read old messages without getting thrown back to the bottom constantly.
The behavior before this fix was that when I was looking at old messages, it jumped around, but at least you were still NEAR the location of what you were reading.
If you see how all the other chat apps work, when you scroll up to look at old messages, you as the user control where you are, there is no auto scroll to the bottom, and no jumping around. You do usually also get a button at the bottom right to just scroll back to the bottom.
Hopefully this was clearer...
from flutter_chat_ui.
Yes, on message sent it's great that it scrolls to bottom. I was talking about received messages. Looking forward to the fix! :D
from flutter_chat_ui.
Regarding incoming messages and being somewhere in the chat history there is no fix. I don't see how it can be done from a library having no control over anything backend related. If we receive a message we add them, it is impossible to have arrays of not rendered messages or something, it will rather break everything else. Unfortunately having some kind of automatic solution may introduce those inconveniences and we will never be on Telegram/Messenger level just because they are apps and not libraries.
from flutter_chat_ui.
Mmm, I don't think the solution is backend related or to stop adding messages when you are not at the bottom... It's probably something with recalculating the scroll position or something like that when you are not at the bottom... but no worries. I'm more than happy to try to find the solution and then send a PR for you to review. Thanks for the quick replies as always
from flutter_chat_ui.
Fixed scroll to bottom for incoming messages here v1.1.4.
As for the jumps in the message history there is no easy fix. If not saving messages to some kind of an array for "future build" while browsing through the history, calculating position is the only option, but
- The list is animated so the height of the element is dynamic (can assume that this is not the problem because jumps are instant, meaning there is no animation when new element is added while browsing history)
- We need to calculate the incoming message(s) height(s), since we may have a date divider, message and spacer coming in at the same time, which is not a trivial task + probably will hurt performance badly (calculating size of List elements not visible on the screen, if possible at all)
There is also this issue flutter/flutter#74031 and I don't think that AnimatedList is fully finished and may need to be improved by Flutter team
from flutter_chat_ui.
Thank you for taking your time to checking this out again. Definitely sounds like a non trivial issue. But it's not unusable so it's not a breaking issue... I'll see if I can figure something out and share if I do. Thanks!
from flutter_chat_ui.
Related Issues (20)
- Image Rendering
- Image sending Empty Bubble displayed (BUG) HOT 9
- SendButtonVisibilityMode.editing: send button not added after typing on samsung keyboard HOT 7
- Is there a feature to download images from chat in the form of photos? HOT 1
- Send message with empty text HOT 1
- Attach emojis to a message? HOT 1
- Changing "inputPlaceholder" doesn't work. HOT 2
- Delay in response when using `bubbleBuilder` with `GestureDetector` in `Chat` widget HOT 4
- typing indicator in chat with no messages HOT 2
- About customDateHeaderText HOT 1
- Add default loadingBuilder for ImageMessage
- Is there any way to display message start from top? HOT 1
- How to change the word "is typing" in TypingIndicatorOptions HOT 2
- While scrolling every message in the chat is rebuilt which is causing performance issues HOT 3
- when trying to send Video Message it successful but the video is invisible HOT 3
- Samsung Keyboard Delete message bug HOT 1
- Padding of text HOT 2
- Transparent `customBottomWidget` HOT 3
- PopScope and TextScaler aren't found HOT 1
- How do I stream messages like chatgpt? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_chat_ui.