· Socialworker by day, developer by night.

Chat Component not updating when conversation changes

Actions & Logic

Scenario:

  • I have a custom component called "chat" that displays messages for a given conversation based on conversation_id.

  • In this component I use supabase and stream query so it shows messages that matches conversation_id to a ListView. Done with backend query on the ListView.

  • Component works for those who only have one chat. I think because it initilizes with correct conversation_id.

  • But it does not work for operators who are suppose to be able to switch between different conversations (chats).

  • When an operator selects a different conversation, the conversation_id is suppose to change in the component and switch to those messages.

What have you tried so far?

I have tried to have conversation_id as a parameter to the component. And also as an AppState. I can't get the component to reload with correct conversation_id when it switches. How can I achieve this?

Did you check FlutterFlow's Documentation for this topic?
No
1
4 replies