Progress Bar not pulling new database values to recalculate % time remaining between two dates

Quick summary of my setup...

I am using a progress bar to visually display the percentage of time remaining between two timestamptz variables stored in supabase. The user enters a name and number of seconds for the timer, and when the user presses "add timer", there is a database refresh on the list view which shows the new item. Within the refreshed list view, the progress bar is correctly calculating and displaying the % time remaining between the date of creation and the "expiration date" which equals created_date + # seconds). There is also another text widget that I am using which calculates and displays the number of seconds remaining before expiration of the timer, and that is also working properly when a new timer is added.

Each item has a button that the user can press to refresh the timer, and when pressed, flutter flow updates the database variable created_date to = current time, and supabase then calculates a new expiration date which equals NEW.created_date + # seconds. That is also all working properly, as when pressed the database reflects a new create_date and new expiration date.

Now here is my issue...

When the timer refresh button is pressed, the progress bar immediately goes to 0 and so does the number of seconds remaining widget. This is confusing me, because the progress bar and seconds remaining widget seem to work perfectly until the timer is refreshed. I suspect that the functions used to calculate those widgets are correct when they are created, but they are using old data after the timer is reset.

I am happy to elaborate or clarify anything if needed. I am very new to app building and flutter flow, so any help would be greatly appreciated.

2 replies