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
ChatListController how to update when stream update? #17
Comments
In my opinion there are 3 usual cases:
In any other case, you can use |
@themadmrj thank u for your reply. I rethinked a little this morning.
Overall, what's the standared way to do in this situation:
Also, I agreed that Btw, it's the possible to add a top widget inside ChatList widget? Sometimes we need add some top bar along with the list such as facebook Messenger. is that possible add a searchBar or add button along with the list? |
@themadmrj Correct me if am wrong, I don't find |
I don't understand when or why you would randomly change the order, if not when a new message is received? As for your widget, which is what you asked in your previous question, you need a header (or footer at the bottom of the list). This feature does not currently exist. If you want it, feel free to make a pull request. I will not implement it myself, because I don't really see the point of a header. In my opinion, a search bar makes more sense when it's static, always visible at the top, and does not scroll with the list. You have access to the |
@themadmrj thanks for your reply. I am not randomly change order. In my case, I have Not sure which way is the proper way to do it. SearchBar can be always visible, but what about some other buttom row, such as Messenger you have your frequent chat friends in the top row? Maybe you have a better way to do it, I just make a feature suggestion. |
Yes, but that's exactly when you should use
No, if you want exactly the same thing, like I said, you need a header. Feel free to make a pull request. The documentation about how to proceed is very rich. I'll review it once you've submitted it and integrate it in the repo. |
@themadmrj I'll try send u a PR. it's that OK to make a header widget as params in ChatList? Or if ChatList can receive |
Don't use shrinkWrap=true since performance is worse. Yes, if the header does not depend on the list items, a Widget passed as a parameter is fine, otherwise a builder is better. |
You're supposed to call |
Hi, to clarify my question, I'll post code in case being missunderstand.
Now I am using this way to add list to _mode.controller:
This works on first init load which addAll list. But when I update the list order in stream, (only update order, not insert or add any items). the stream will update right? But there addAll will add all again. But I just need update. So that the list will add twice.
My question is, currently ChatListController only have a addAll function, how to update the order anyway? If it have .clear() then I can just clear and addAll, but currently not same as List in dart. What should users do in this siutation?
The text was updated successfully, but these errors were encountered: