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.35k stars 148 forks source link

Add new type of scope that is independ of the scope stack #342

Open escamoteur opened 1 year ago

escamoteur commented 1 year ago

It seems that many people use scopes mainly to be able to dispose of a whole bunch of objects with one call and that the shadowing feature of the scope stack isn't the most important to them. With the addition of dropScope() we already started the ability to access a scope independent of the stack position.

Also, I was asked what to do if you want a scope for each entry of a tab in a tabview, that would be more or less parallel and not fit the stack structure of current scopes.

This is currently just a reminder on this topic but feel free to add your ideas how a future version of get_it should handle scopes

kodhi-tech-lead commented 5 months ago

Keeping the scope stack hierarchical and then adding groups where groups are non-hierarchical and each scope layer can contain multiple groups would be neat.