How can I update the data automatically without refreshing the page in firebase flutter?

Viewed 387

I have to display total number of Sales and pending sales in the dashboard. I have designed inside the container. I need to update that every time new sales adds to Firebase Firestore automatically. How can I achieve this.

2 Answers

I would suggest a Streambuilder which listens to Firebase document that has a field called "Sales" and when the field is modified it will automatically be updated in the UI ( Container widget)

Related