fluttercommunity / get_it

Get It - Simple direct Service Locator that allows to decouple the interface from a concrete implementation and to access the concrete implementation from everywhere in your App. Maintainer: @escamoteur
https://pub.dev/packages/get_it
MIT License
1.36k stars 149 forks source link

Collections Multibinding #349

Closed vscmaster closed 10 months ago

vscmaster commented 1 year ago

Hi get_it team,

I have a proposition to extend injection with the same type into collection.

I many years been using such approach with Dager multibinding and it very convenient way to support dynamic typed behaviours and abstract factories. Like parsers, creators, decorator, etc.

Thank you.

escamoteur commented 1 year ago

Hi,

can you elaborate on how this should work? Am 16. Nov. 2023, 20:57 +0100 schrieb vscmaster @.***>:

Hi get_it team, I have a proposition to extend injection with the same type into collection. I many years been using such approach with Dager multibinding and it very convenient way to support dynamic typed behaviours and abstract factories. Like parsers, creators, decorator, etc. Thank you. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

vscmaster commented 1 year ago

Hi, can you elaborate on how this should work? Am 16. Nov. 2023, 20:57 +0100 schrieb vscmaster @.>: Hi get_it team, I have a proposition to extend injection with the same type into collection. I many years been using such approach with Dager multibinding and it very convenient way to support dynamic typed behaviours and abstract factories. Like parsers, creators, decorator, etc. Thank you. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.>

Sure, lets think about some interface, I'll call it DeepLink and several impls, HomeDeepLink, CatalogDeepLink, DetailsDeepLink, etc.

and with the GetIt we will register them(even with the scope also). GetIt.registerInToSet<DeepLink>(HomeDeepLink())

then we'll call it like this GetIt.getSet<DeepLink>(), this will return the Set<DeepLink>.

escamoteur commented 1 year ago

I guess that is the same as this issue here? https://github.com/fluttercommunity/get_it/issues/75

escamoteur commented 10 months ago

@vscmaster haven't heard from you?

vscmaster commented 10 months ago

@escamoteur yes its the same wishes like described in the #75 Im gonna close the thread thank you.