Комментарии:
Thanks a lot ❤
ОтветитьThank you very much!
ОтветитьPlease don't mislead non-senior devs into thinking this is dependency injection. A service locator is not the same as dependency injection. SL is actually an anti pattern (the book "Dependency Injection: Principles, Practices and Patterns" explains why). For a real DI library for Dart/Flutter see Inject.
ОтветитьThanks, this is a great explanation. I struggled to understand this until I found your video. Thanks so much!
Ответитьyou make it super easy. and that is not fair🤣
ОтветитьHi.. Would like to know the config you used with your vscode? Theme, font.. thanks
ОтветитьQuality content. Thank you.
ОтветитьThanks for the tutorial. I do have a question. This approach kind of goes against dependancy injection pattern, doesn't it? Having a global object that exposes all its members to anything is the opposite of DI, right? Isn't it bad?
ОтветитьI really like the idea of a service locator, especially that it is flutter independent as I understand. In other words, I don't need to pass something around the widgets like with provider. I would be interested, if this works well with the bloc pattern. instead of flutter_bloc, which uses provider under the hood for DI, couldn't I use get_it? Would be great if you could share your thoughts on that. Thks for the great video!
ОтветитьWhat are the use cases of this when i can normally use the normal dependency injection in Provider for example? any singleton class would do that then where is the advantage?
ОтветитьThanks!!
ОтветитьAfter searching the internet and reading medium articles to little satisfaction, this did justice to everything. Thank you very much. Subscribed!!
ОтветитьI have a question pls guide, how GetIt handles garbage collector as it registeres so many object before hand does it mean all those objects will remain in memory till app lifecycle ? or Objects will be wiped off by garbage collector if yes then when pls guide
ОтветитьReally cool, thanks my dear friend
ОтветитьThanks to you :)
Ответитьthank you i get it
ОтветитьFinally!!! I was now able to understand how to use it and what is it, thanks :)
Ответитьthank's very much very clear
ОтветитьI have a quesion why did we not use a memeDomainCOntroler when we could directly call the meme repo as thats what is happening.
ОтветитьI was too lazy to read the documentation 😂.. thanks you were there🥰
ОтветитьCan you make an video for getit with provider ?
ОтветитьExcellent video! I do have a question though, if you can help. I was hoping get_It would be a state management solution that automatically updates the UI when changes are made like provider with notifylisteners, without the context from a widget being required. You've made it clear it's not. Are there any state management packages that can do the same thing provider can do, but without the context? Thanks in advance
ОтветитьAny of u guys have example for locator.registerLazySingletonAsync<,MemeController>(() => async { await MemeController.init();}) ?, or let say if you want to call init method ini MemeController, i tried but seems it is not working
Ответить👍🏻
ОтветитьDependency Injection Pattern left the chat
ОтветитьThanks
ОтветитьServiceLocator seems to be "god-singleton" class. Never did i think of using 2 really bad words in programming at the same time.
Ответитьhi there, how to unregister singleton using injectable ?
Ответитьgood example for how to use get_it in real project, thanks
ОтветитьPlease subtitle on you video. Im from indonesia
ОтветитьI think Get X could be a better alternative because many things can be done with one package
ОтветитьWhen I use Riverpod I don't need any Dependency Injection 😁
ОтветитьWhy we not just create a meme object and to use getMeme?
Ответитьbut..... all benefit about stateManagement is broken by setState........
ОтветитьFirst, thanks a lot for the video. For those who don't know me I m the author of get_it.
1. Getit isn't a state management solution but together with the get_it_mixin it gets one.
2. LazySingletons do not vanish magically when you don't need them anymore, you have to unregister them if needed at all or use the scope functions of get_it.
3. You don't have to call 'get' because GetIt is a callable class.
You can write
locator<MyService>().myServiceMethod;
4. GetIt has many more features to check out. Like startup synchronisation, and scopes. It's worth to read the readme 😁
Great class. I would like to see now an integration with provider for state management. Could i use 'with changeNotifier' in MemeRepo class? Thanks
Ответить