listenTo method
StreamSubscription<PostCommentModel?>
listenTo(
- String documentId,
- PostCommentChanged changed, {
- PostCommentErrorHandler? errorHandler,
override
Implementation
@override
StreamSubscription<PostCommentModel?> listenTo(
String documentId, PostCommentChanged changed,
{PostCommentErrorHandler? errorHandler}) {
var stream =
postCommentCollection.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;
}