Hi,
I have a posts feed on my app like this:
The feed API gets the feed and in each post element it has the data if the post is already liked or not.
I have the like button in a conditional builder. If the post is liked it has color otherwise it has outline.
This is the action I have defined for the button like:
Similarly I have one for unlike.
The expected functionality is that the button should change state based on action success.
I am able to achieve expected functionality if I keep the API call for feed outside (in a parent container) the ListView for feed.
But I need to paginate the feed and for that I need to make the API call in the ListView widget.
When I move the API call to ListView the visual state change stops. The api call works fine but the button doesn't change as per the state until I pull down to refresh the list. But then the track of the current post is lost.
Any way to solve this? Please help.