listenTo method
StreamSubscription<FeedFrontModel?>
listenTo(
- String documentId,
- FeedFrontChanged changed, {
- FeedFrontErrorHandler? errorHandler,
override
Implementation
@override
StreamSubscription<FeedFrontModel?> listenTo(
String documentId, FeedFrontChanged changed,
{FeedFrontErrorHandler? errorHandler}) {
var stream =
feedFrontCollection.doc(documentId).snapshots().asyncMap((data) {
return _populateDocPlus(data);
});
var theStream = stream.listen((value) {
changed(value);
});
theStream.onError((theException, theStacktrace) {
if (errorHandler != null) {
errorHandler(theException, theStacktrace);
}
});
return theStream;
}