'Is it possible to update a list of data using Firestore Stream in Flutter?

In my app, I have a list of "students" called "_myStudents". To check if a new student has joined my class, I use a "refresh" button which checks on Firestore if a new student is present in a collection document : so I download the collection into "_myStudents" list again. This works fine. But I would like "_myStudents" to update automatically without having to refresh and download. I read I could use STREAMS for that. BUT, and here is my problem, I saw that you can display the data from the stream using STREAM BUILDER... STREAMBUILDER seems to return WIDGETS. All I would like is STREAMBUILDER to update my list "_myStudents".

Is there a way to do this ?

Thanks for your help.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source