About Unread Message function

Actions & Logic

I am developing a feature for unread message notifications, and my plan is as follows:

1. At the initialization of a certain page, I retrieve data with a status of "unread" from Supabase and save it to the "unreadMessages" in appstate.

2. I have set up a badge on a certain page, which will decide whether to display it and the number of messages displayed based on the number of unreadMessages.

3. When the user enters the Message page, I want to notify Supabase to update the status of all unreadMessages in the Message table to "read".

Now I am stuck at the third step because I don't know how to match the id of the Message table in Supabase with the id of unreadMessages.

What have you tried so far?

I have tried setting the type of unreadMessage to an array of strings, and also to an array of JSON, but every time I update a supabase row, I don't know how to match the data.

Did you check FlutterFlow's Documentation for this topic?
Yes
2
1 reply