Bloc: How do I replace BlocSupervisor().delegate when upgrading to 6.0.5?

Created on 18 Sep 2020  路  5Comments  路  Source: felangel/bloc

Hi. I was previously on a very old version of flutter bloc, 3.0.1. I am trying to upgrade to 6.0.5, and have fixed everything except for this line:

BlocSupervisor.delegate = BlocTransitionListener(userLoggingInfo: sentryLogging);

Both BlocSupervisor and BlocSupervisor() are now undefined.

I can't find the new method of listening to all my bloc transitions. Please help, thank you

question

Most helpful comment

@felangel thanks for the response.
My apologies. I didn't read correctly. All set now. Thanks

All 5 comments

Hi @MilesAdamson 馃憢
Thanks for opening an issue!

Please refer to the migration guide. Let me know if you still have questions 馃憤

Quick response and quick fix, already working. thank you!

Bloc.observer = BlocTransitionListener(userLoggingInfo: sentryLogging);

class BlocTransitionListener extends BlocObserver {

Quick response and quick fix, already working. thank you!

Bloc.observer = BlocTransitionListener(userLoggingInfo: sentryLogging);

class BlocTransitionListener extends BlocObserver {

Thanks for this quick fix!
The migration guide should make this clear.
I got stuck try to set an observer on MyAppBloc (instead of the parent Bloc class!) :(

@ajaygautam this should be covered in the migration guide. Let me know if it was unclear/confusing and if there's anything you'd like to add or adjust 馃憤

@felangel thanks for the response.
My apologies. I didn't read correctly. All set now. Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bernaferrari picture bernaferrari  路  43Comments

konstantin-doncov picture konstantin-doncov  路  30Comments

endigo picture endigo  路  34Comments

hahai96 picture hahai96  路  40Comments

fvisticot picture fvisticot  路  31Comments