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
Hey, I'd like to know whether registered object is singleton or not.
Use case:
I have a wrapper widget around Cubit/Bloc which retrieves correct instance of bloc from getIt,
but I have an issue when I'm trying to close/dispose the bloc, there are two cases
Bloc is registered as factory, meaning it okay to close it after its widget disposes
Bloc is Singleton/lazy and I don't want to close it after its widget disposes, but I can't tell if bloc is singleton or not without passing specific parameter to cubit wrapper widget
Possible solution would be to expose _ServiceFactoryType and call getIt.type() or getIt.typeOf<T>()
The text was updated successfully, but these errors were encountered:
I know that it's been a long time, but I had to make a longer break due to health issues.
Why not simply add a bool flag inside the Bloc object that tells if it can be disposed? or isn't it clear when the Bloc is created if it's used inside a factory or singleton?
Hey, I'd like to know whether registered object is singleton or not.
Use case:
I have a wrapper widget around Cubit/Bloc which retrieves correct instance of bloc from getIt,
but I have an issue when I'm trying to close/dispose the bloc, there are two cases
Possible solution would be to expose
_ServiceFactoryType
and call getIt.type() orgetIt.typeOf<T>()
The text was updated successfully, but these errors were encountered: