Do we really need get_it? A simple, zero-dependency alternative for service location in Flutter.
I’ve lost count of how many times I’ve seen get_it used in Flutter projects. And every time, I ask myself: Do we really need it?
To implement a basic service locator, many developers reach for an external package right away. Sure, it works. But each dependency adds risk: version conflicts, breaking changes, and extra maintenance as Flutter and Dart evolve.
In most cases, a small, self-contained class does the job just fine. No magic. No overhead. Just a clean solution for registering and accessing services and repositories globally – and nothing more.
I wrote a minimalist service locator that covers exactly what’s needed. One class. Three methods. Easy to understand, easy to use – and you can just drop it into any project.
We don’t need a package for every basic utility. Especially not for something as fundamental as this. Less dependency means fewer surprises – and better maintainability in the long run.
Maybe this little class helps in your next project. Or maybe it inspires you to rethink where an extra package is really worth it 😉
How do you handle service registration in your apps – external package or custom logic?