Closed fer-ri closed 3 years ago
Hi
Thanks for your package. It saves a lot of my time :+1:
Btw, I noticed that when using isLive option as true, the stream is always active even we moved into another screen.
isLive
true
We need to capture the StreamSubscription from this line https://github.com/excogitatr/paginate_firestore/blob/master/lib/bloc/pagination_cubit.dart#L86 and cancel() on dispose.
StreamSubscription
cancel()
dispose
Something like this
List<StreamSubscription<QuerySnapshot>>() streams = List<StreamSubscription<QuerySnapshot>>(); ... _getLiveDocuments() { ... StreamSubscription listener = localQuery.snapshots().listen((querySnapshot) { _emitPaginatedState( querySnapshot.docs, previousList: loadedState.documentSnapshots as List<QueryDocumentSnapshot>, ); }); } streams.add(listeners); } ... streams.forEach((listener) => listener.cancel());
Thanks
Thanks for making a PR @ghprod. I will be released with the next version. Feel free to reopen it if you face a similar issue.
Hi
Thanks for your package. It saves a lot of my time :+1:
Btw, I noticed that when using
isLive
option astrue
, the stream is always active even we moved into another screen.We need to capture the
StreamSubscription
from this line https://github.com/excogitatr/paginate_firestore/blob/master/lib/bloc/pagination_cubit.dart#L86 andcancel()
ondispose
.Something like this
Thanks