A blazing-fast, type-safe service locator for Dart and Flutter that provides O(1) access to dependencies without BuildContext.
get_it is a service locator package for Dart and Flutter that provides a simple, type-safe container for managing application dependencies. It solves the problem of tightly coupled code by allowing objects to be registered once at startup and accessed from anywhere in the app without needing a BuildContext. This decouples interface from implementation and simplifies dependency management as apps grow.
Flutter and Dart developers building medium to large applications who need a clean, performant way to manage dependencies across business logic, utilities, and UI layers. It's particularly useful for teams prioritizing testability and maintainability.
Developers choose get_it for its exceptional performance with O(1) lookups, compile-time type safety, and zero boilerplate—no code generation or complex setup required. Its framework-agnostic design and seamless integration with Flutter's ecosystem, including a dedicated DevTools extension, make it a robust, developer-friendly choice over manual dependency passing or heavier solutions.
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
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses O(1) lookups with Dart's native Maps, avoiding reflection or slow searches, as highlighted in the README's key features.
Leverages Dart generics for full type checking, catching dependency errors before runtime, ensuring robust code.
Allows easy swapping of real implementations for mocks and provides reset functionality between tests, improving test isolation as documented.
Works in Flutter, pure Dart, server-side, and CLI apps without Flutter dependencies, making it versatile for cross-platform projects.
Requires no build_runner or annotations; dependencies are registered and accessed directly, reducing setup complexity and overhead.
Misregistrations or missing dependencies can only be caught at runtime, unlike compile-time DI solutions, leading to potential crashes in production.
The service locator pattern introduces hidden dependencies and global state, which can violate clean architecture principles and make code harder to maintain.
While scopes are supported, hierarchical registration for different app states requires careful manual setup and cleanup, increasing cognitive load and error risk.