get-it-expert

Installation
SKILL.md

get_it Expert - Service Locator & Dependency Injection

What: Type-safe service locator with O(1) lookup. Register services globally, retrieve anywhere without BuildContext. Pure Dart, no code generation.

CRITICAL RULES

  • Register all services BEFORE runApp()
  • pushNewScope() is synchronous. Use pushNewScopeAsync() for async init
  • popScope() IS async (returns Future<void>)
  • allReady() returns Future<void> - await it or use FutureBuilder/watch_it
  • Dispose callbacks are a parameter on registration methods, not separate methods
  • Once async singletons are initialized (after allReady()), access them with normal getIt<T>() - no getAsync needed
  • If using watch_it, a global di alias for GetIt.I is already provided - use di<T>() instead of getIt<T>()

Registration

final getIt = GetIt.instance;
Related skills
Installs
11
GitHub Stars
1.5K
First Seen
Feb 19, 2026