Comments (4)
@zahidshaikh08 my comment above should solve the issue, it is how we planned it work, it is how it works with Firebase.
We had stateful widget before and it didn't work, don't remember the problem exactly, but it was so bad we replaced it with stateless widget and came up with this callback/user stores data system.
Not an option to keep these in memory since this chat should work on thousands of messages.
from flutter_chat_ui.
@demchenkoalex haha I completely missed it! I didn't realize the strategy was to update firestore with the preview, I thought it was expected to do it on the fly (locally) each time. That clears it up for sure, makes sense.
from flutter_chat_ui.
Hi, thanks for asking. Flutter fully reloads visible messages when update happens, we can't do anything about it. Regarding the preview, as you can see in the example here https://github.com/flyerhq/flutter_chat_ui/blob/main/example/lib/main.dart#L148 or inside the Firebase lib https://github.com/flyerhq/flutter_firebase_chat_core/blob/main/example/lib/chat.dart#L167 you need to implement onPreviewDataFetched
and update your message on backend so it contains filled previewData
. In our Firebase implementation when we update something it immediately syncs so basically you have previewData
set and our preview library works in a way that when previewData
is set it will use it instead of trying to unwrap once again. In your case there is no sync probably, so maybe you can try to update messages on backend and locally and it should stop trying to fetch the preview with each update.
from flutter_chat_ui.
Don't you think instead of making message.dart a StatelessWidget we can have a StatefulWidget which might solve this issue. Didn't tried just an OPINION, i don't know if it will work or not but we can try this.
Or if performance is not concerned we can even add AutomaticKeepAliveClientMixin to message.dart so that it will not loose its state while refreshing or building state again on new messages add or list change. Again it's just an OPINION didn't tried.
from flutter_chat_ui.
Related Issues (20)
- Should I use inputOptions or customBottomWidget to achieve the effect I need? HOT 3
- Performanec issue, the whole list just got some sort of laggy HOT 3
- Japanease character fixed before conversion HOT 4
- video from url HOT 3
- Expose more properties for customization without overriding everything. HOT 2
- Why work on this whole code, and in the end not enable users to seemlessly change colors, but force them to create entire themes? This is very unpractical. I also have an issue with the send Icon an dhow the keyboard has to be invisible before it shows up. HOT 4
- Image Loading HOT 3
- How to display programming code as colorful and correctly formatted HOT 1
- Duplicate GlobalKey detected in widget tree. HOT 3
- Add select emogi just Like whatsApp, for now its taking default keyboard emoji HOT 1
- Unable to load asset ( icon-send.png). Whenever i try to write something for every letter the new letter goes to newline HOT 3
- Do not scroll to the bottom of long chat response if the message takes more than full screen height. HOT 3
- Make it possible to customize the chat bubbles width HOT 5
- Undefined Chat argument `isLeftStatus` is used in the example project HOT 1
- Adding the default bubbled message to the bubbleBuilder HOT 1
- Text Field prevent losing focus when tapping anywhere on the chat
- Not much info about "defaultBubbleMessage" after interface change on minor version update HOT 7
- Is it possible to scroll to the first message but without `ScrollToUnreadOptions` HOT 1
- Received message flash gray. HOT 5
- Get to know the height of the input widget depending device HOT 1
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.