I have a naive question, I have read about the flutter dependency injection package get_it, it registers all the instances at start like the service locator design pattern, my question is how it deals with a garbage collector and when it frees the objects? Does it store all the instances in memory at start till app lifeCycle?
To be honest, I know very little about Service locator design pattern otherwise I might have understood this package clearly, Now I need your help on how it works under the hood? what if we need to register an instance at run time with some dynamic data coming from API then how can we do that?
Your help will be appreciated thanks in advance
Per the documentation, you can unregister a previously registered instance as follows:
Service objects are often need throughout the life of an application, in which case you'll never need to unregister.