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
If you need to you can also unregister your registered singletons and factories and pass a optional disposingFunction for clean-up.
However, when calling unregister with a factory instance, I get this error:
The following StateError was thrown while finalizing the widget tree:
Bad state: This instance of the type "SomeFactory" is not available in GetIt If you have registered
it as LazySingleton, are you sure you have used it at least once?
I am trying to unregister the factory to dispose some variables when exiting a page.
I am calling it in the dispose function.
As a Factory creates a new instance on every call you can't use the instance to unregister.
You have to unregister it with the same Type and (name if you used one) as when you registered.
Maybe have also a look at the new Scope functions in V5,perhaps they can make your live easier
Hey,
In the documentation it says:
However, when calling unregister with a factory instance, I get this error:
I am trying to unregister the factory to dispose some variables when exiting a page.
I am calling it in the dispose function.
Thanks for your help
The text was updated successfully, but these errors were encountered: