listenTo method
StreamSubscription<AccessModel?>
listenTo(
- String documentId,
- AccessChanged changed, {
- AccessErrorHandler? errorHandler,
override
Implementation
@override
StreamSubscription<AccessModel?> listenTo(
String documentId, AccessChanged changed,
{AccessErrorHandler? errorHandler}) {
var stream = accessCollection.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;
}