listenTo method
StreamSubscription<FaderModel?>
listenTo(
- String documentId,
- FaderChanged changed, {
- FaderErrorHandler? errorHandler,
override
Implementation
@override
StreamSubscription<FaderModel?> listenTo(
String documentId, FaderChanged changed,
{FaderErrorHandler? errorHandler}) {
var stream = faderCollection.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;
}