Describe the bug
I have a screen that calls a view event on a blog from my
Question
why is this happening ?
Is it because if didn't scope the two different instances well ,if so how would I scope it cos I have used every means I could find online.
All Codes
event handling viewEvent
if (event is ViewPost) {
try {
await _blogRepo.getAndUpdateViews(id: event.postId);
yield ViewSuccess();
} catch (e) {
yield ViewFailed(err: e);
}
}
code that update the firebase
Future<int> getAndUpdateViews({@required String id}) async {
await _collection.document(id).updateData({VIEWS: FieldValue.increment(1)});
return 0;
BlocListener and BlocBuilder


methods to handle navigation
void nextScreen(index, id) {
var info = {'index': index, 'blogPost': id};
detailedBlog = info;
}
void goToDetailed(context) {
Navigator.of(context).pushNamed('/blogDetailed', arguments: detailedBlog);
}
Hi @davidAg9 馃憢
Thanks for opening an issue!
Are you able to provide a link to a sample app which I can clone and run locally to reproduce the issue? Thanks! 馃憤
Fortunately you are a contributor since its a private repository
I think I was over using bloc although and since I wasn't popping any route in the above issue it kept the bloc listening for other states
To any one with the same issue ,you can consider the issue to be you bloc is still alive when routing to a new screen which indicates break some of it task into other blocs ,other properly popPush or pop and replace to close the bloc
Most helpful comment
To any one with the same issue ,you can consider the issue to be you bloc is still alive when routing to a new screen which indicates break some of it task into other blocs ,other properly popPush or pop and replace to close the bloc