Having the data be a stream
Opened this issue · 0 comments
How would you recommend having the data thats fed to the sticky grouped list to be if its a stream?
I'm trying to build a messaging app, so I have a stream that listens to the database and gets a snapshot each time. I then put the StickyGroupedList widget in the StreamBuilder as follows:
I do however get the error that the stream is already being listened to, and I worked around it by making the streamController in the StickyGroupedListViewState a broadcast stream:
StreamController _streamController = StreamController.broadcast();
Is this a valid way of solving it? Or would I be breaking something down the line eventually? Because now I'm getting the error that the .toDate() function does not work on null, so there is some downtime between when toDate() is called and when the object appears so that toDate() can actually use it.