You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my app, i have a FavoritesCubit that streams data from my database. Every time the UserCubit changes, the stream of FavoritesCubit is canceled and then restarted. For this, i use BlocListener, from flutter_bloc package.
FavoritesCubit contains data that are only accessible through a secondary page in my app, it is not on the home page.
The thing is, when i launch my app, the BlocListener instantly prevents my FavoritesCubit of the changes. So the BlocProvider instantly creates the FavoritesCubit, and dependency injection is useless.
I wish i could detect, from the BlocListener, if the FavoritesCubit has already been created or not. This way, it will only be updated when needed.
In my app, i have a FavoritesCubit that streams data from my database. Every time the UserCubit changes, the stream of FavoritesCubit is canceled and then restarted. For this, i use BlocListener, from flutter_bloc package.
FavoritesCubit contains data that are only accessible through a secondary page in my app, it is not on the home page.
The thing is, when i launch my app, the BlocListener instantly prevents my FavoritesCubit of the changes. So the BlocProvider instantly creates the FavoritesCubit, and dependency injection is useless.
I wish i could detect, from the BlocListener, if the FavoritesCubit has already been created or not. This way, it will only be updated when needed.
I think something like this would be enough :
So i would write :
What do you guys think about it ?
The text was updated successfully, but these errors were encountered: