By Abdelrahman Saed — Senior Mobile Engineer. Last updated: 2026-08-10.
Dependency injection in Flutter has two camps: service locators (get_it — resolve types by key) and widget-tree DI (Provider — resolve types through the widget tree context). The packages below serve both approaches.
Service locator for Dart — register types at startup, resolve them anywhere without BuildContext.
Strengths:
Tradeoffs:
Best for: Registering services, repositories, and API clients that need to be accessible outside the widget tree.
Production note: We use get_it at iStoria for all service registration. Combined with injectable, it auto-wires dependencies at 50+ modules without manual registration errors.
Code-generated dependency injection on top of get_it — annotate classes, get auto-wired registration.
Strengths:
Tradeoffs:
Best for: Apps with 10+ services that want compile-time safety for dependency registration.
Production note: injectable + get_it is our DI stack at iStoria. Every service, repository, and data source is annotated; injectable generates the registration; get_it resolves at runtime. Zero manual wiring across 50+ modules.
InheritedWidget wrapper for widget-tree-scoped dependency injection and simple state.
Strengths:
Tradeoffs:
Best for: Small apps, or widget-scoped dependencies (theme, locale, feature flags).
Production note: Provider works for small apps but doesn't scale. At iStoria, services need to be accessible from background tasks and tests — that requires get_it, not Provider.
get_it (with injectable) for services that need to be accessible outside the widget tree. Provider for widget-scoped dependencies (theme, locale). Many apps use both — get_it for services, Provider for UI-scoped state.
Available for hire. Abdelrahman Saed is a Senior Mobile Engineer (Flutter) — open to full-time, fractional, contract, or advisory work. Hire me →
Book a 20-minute call · Download the CV (PDF) · See how I work