How to make favourite button show the right color inside a component

Actions & Logic

The goal: is to show a red heart icon when the user is in a 'favorite' array, ELSE it shows a grey heart icon.

Situation: Right now, the icon gets displayed correctly on the initial load (From Firebase), and every time, you click on the icon, it either adds or removes the user from the 'favorite' array. The only problem is that the icon color doesn't react according to the data (It doesn't change colors when I tap the icon)

What have you tried so far?
  • I've tried to replace the icon with a toggle icon, but it doesn't seem to find any variables to set the initial state when it's in a component?

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