-
-
Notifications
You must be signed in to change notification settings - Fork 153
How do you wait for factories to be ready #406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Are you really registering factories or async singleons? |
I am registering factories (for cubit creators) and singletons (not async) for repositories. But I get an error stating that a cubit instance could not be retrieved using a factory cause it has not been registered yet. Since the docs for the factories explain that factories registration occurs immediately, and I am registering them before the piece of code where I try to get this first cubit instance, this should not happen, right? |
Indeed, if you do the registration as the first thing at startup that should never happen. can you verify with logging that you really don't try to access the cubit before you register it? If not I would need a project that shows that behavior that I could debug |
Hello,
I'm registering multiple factories in my app, and on some cases when I launch the app, i get an exception stating that the factory was not registered. But if I add a little delay on purpose using await Future.delayed in my splash screen, this works fine.
The text was updated successfully, but these errors were encountered: