Hello FlutterFlow community,
I'm building an app where users (clients) can leave reviews for service providers. Each review includes a rating (from 1 to 5). I need to calculate the total rating and the average rating for each provider dynamically, every time a new review is added. However, I'm facing a challenge.
Here’s the issue:
I need to sum the ratings of all reviews for a provider and calculate the average.
I can query the reviews using the Firestore query and get a list of reviews for a specific provider (using the
reviewed_user_ref
).The challenge is: how can I dynamically sum the ratings and calculate the average for all reviews in the list without manually adding an action for every new review that a client leaves?
I want to avoid manually adding an action for each review and instead find a way to automatically update the total and average ratings when a new review is submitted.
Is there a way to achieve this in FlutterFlow? Can we iterate through the list of reviews dynamically or use a different approach to update the total and average ratings?
Any help or guidance would be greatly appreciated!
Thank you!