-
-
Notifications
You must be signed in to change notification settings - Fork 153
Singleton not being instantiated #127
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
Hi, I'm not fully sure. Some clarificaions: 1.: using isReady, allReady only makes sense if you have some async initialization in the objects that you register in get_it. if you could show me a bit more code of your MainMapi constructor it might help me to help you further. |
Hi thanks for you fast response, I do not really have any async initializations in my object, maybe there I am doing something wrong. Well the MainApi is very very basic at the moment, not sure if that will help but, here it is:
} |
In that case you don't have to use isReady or allReady at all because Dart is singel threaded. |
Thank you so much, I will try it! |
It works, you were right, no need for |
Uh oh!
There was an error while loading. Please reload this page.
I've got a very simple flutter app, where, at the very beginning I have:
---- main.dart ----
--- dependencies.dart
----- MyApp.dart ------
And when I try to use
api
on any other part of the class I get a Null exception, even inside a FutureBuildwe where I am using asfuture: getIt.allReady(),
The message API HAS BEEN INITIALIZED is never printed.
what am I doing wrong here?? tried to follow the example as much as I can.
The text was updated successfully, but these errors were encountered: