Get_It package - Dependency Injection with Service Locator Pattern in Flutter & Dart

Get_It package - Dependency Injection with Service Locator Pattern in Flutter & Dart

Flutter Explained

3 года назад

42,305 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Moaz El-sawaf
Moaz El-sawaf - 27.04.2023 03:18

Thanks a lot ❤

Ответить
Anas Albattiri
Anas Albattiri - 31.03.2023 07:57

Thank you very much!

Ответить
Scientist
Scientist - 04.03.2023 11:20

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.

Ответить
Man on the Outside
Man on the Outside - 27.02.2023 00:32

Thanks, this is a great explanation. I struggled to understand this until I found your video. Thanks so much!

Ответить
YONATHAN HAILEMELEKOT
YONATHAN HAILEMELEKOT - 24.02.2023 20:18

you make it super easy. and that is not fair🤣

Ответить
Hamourabi Mr
Hamourabi Mr - 14.09.2022 03:40

Hi.. Would like to know the config you used with your vscode? Theme, font.. thanks

Ответить
N Bits
N Bits - 07.05.2022 04:28

Quality content. Thank you.

Ответить
Isuru Nanayakkara
Isuru Nanayakkara - 10.04.2022 13:17

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?

Ответить
Christian Marpert
Christian Marpert - 25.03.2022 15:23

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!

Ответить
Ziyad Mansy
Ziyad Mansy - 12.03.2022 13:15

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?

Ответить
Thomas Moore
Thomas Moore - 22.02.2022 15:17

Thanks!!

Ответить
Michael Okhaimoh
Michael Okhaimoh - 03.02.2022 20:25

After searching the internet and reading medium articles to little satisfaction, this did justice to everything. Thank you very much. Subscribed!!

Ответить
Life With Majid
Life With Majid - 17.01.2022 21:22

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

Ответить
florFluitter
florFluitter - 21.11.2021 10:13

Really cool, thanks my dear friend

Ответить
KEMAL TÜRK
KEMAL TÜRK - 17.11.2021 10:12

Thanks to you :)

Ответить
test test
test test - 18.10.2021 03:25

thank you i get it

Ответить
Make My Pet! GameDev Process
Make My Pet! GameDev Process - 25.07.2021 15:58

Finally!!! I was now able to understand how to use it and what is it, thanks :)

Ответить
saliou seck
saliou seck - 27.06.2021 10:00

thank's very much very clear

Ответить
Rudransh Awasthi
Rudransh Awasthi - 20.06.2021 13:53

I have a quesion why did we not use a memeDomainCOntroler when we could directly call the meme repo as thats what is happening.

Ответить
Google User
Google User - 13.06.2021 18:26

I was too lazy to read the documentation 😂.. thanks you were there🥰

Ответить
Jai
Jai - 09.06.2021 09:48

Can you make an video for getit with provider ?

Ответить
Tawanda Gutsa
Tawanda Gutsa - 28.04.2021 18:01

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

Ответить
Jacob Handaya
Jacob Handaya - 25.04.2021 12:57

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

Ответить
Денис Максимов
Денис Максимов - 06.04.2021 18:44

👍🏻

Ответить
Ion Olaru
Ion Olaru - 31.03.2021 17:39

Dependency Injection Pattern left the chat

Ответить
Amit Singh
Amit Singh - 06.03.2021 20:01

Thanks

Ответить
Ben B
Ben B - 06.03.2021 13:17

ServiceLocator seems to be "god-singleton" class. Never did i think of using 2 really bad words in programming at the same time.

Ответить
kopianan
kopianan - 27.01.2021 19:23

hi there, how to unregister singleton using injectable ?

Ответить
ahmed adnan
ahmed adnan - 22.11.2020 18:32

good example for how to use get_it in real project, thanks

Ответить
Syahrul Ilham Muttaqien
Syahrul Ilham Muttaqien - 06.11.2020 08:33

Please subtitle on you video. Im from indonesia

Ответить
Aşkın Bilir
Aşkın Bilir - 06.11.2020 01:41

I think Get X could be a better alternative because many things can be done with one package

Ответить
Arnas
Arnas - 06.11.2020 00:22

When I use Riverpod I don't need any Dependency Injection 😁

Ответить
number one
number one - 06.11.2020 00:00

Why we not just create a meme object and to use getMeme?

Ответить
Francesco Freddi
Francesco Freddi - 05.11.2020 20:50

but..... all benefit about stateManagement is broken by setState........

Ответить
Thomas Burkhart
Thomas Burkhart - 05.11.2020 18:29

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 😁

Ответить
Diego Carvalho
Diego Carvalho - 05.11.2020 17:53

Great class. I would like to see now an integration with provider for state management. Could i use 'with changeNotifier' in MemeRepo class? Thanks

Ответить