Why Use This This skill provides specialized capabilities for HoangNguyen0403's codebase.
Use Cases Developing new features in the HoangNguyen0403 repository Refactoring existing code to follow HoangNguyen0403 standards Understanding and working with HoangNguyen0403's codebase structure
Install Guide 2 steps 1 2 Install inside Ananke
Click Install Skill, paste the link below, then press Install.
https://github.com/HoangNguyen0403/agent-skills-standard/tree/develop/skills/flutter/dependency-injection Skill Snapshot Auto scan of skill assets. Informational only.
Valid SKILL.md Checks against SKILL.md specification
Source & Community
Updated At Jan 18, 2026, 04:24 AM
Skill Stats
SKILL.md 43 Lines
Total Files 1
Total Size 0 B
License NOASSERTION
---
name: Flutter Dependency Injection (Injectable)
description: Standards for automated service locator setup using injectable and get_it. Use when configuring dependency injection with injectable and get_it in Flutter.
metadata:
labels: [dependency-injection, injectable, get_it]
triggers:
files: ['**/injection.dart', '**/locator.dart']
keywords: [GetIt, injectable, singleton, module, lazySingleton, factory]
---
# Dependency Injection
## **Priority: P1 (HIGH)**
Automated class dependency management using `get_it` and `injectable`.
## Structure
```text
core/injection/
├── injection.dart # Initialization & setup
└── modules/ # Third-party dependency modules (Dio, Storage)
```
## Implementation Guidelines
- **Automated Registration**: Use `@injectable` annotations; avoid manual registry calls.
- **@LazySingleton**: Default for repositories, services, and data sources (init on demand).
- **@injectable (Factory)**: Default for BLoCs to ensure state resets on every request.
- **Abstract Injection**: Always register implementations as abstract interfaces (`as: IService`).
- **Modules**: Use `@module` for registering third-party instances (e.g., `Dio`, `SharedPreferences`).
- **Constructor Injection**: Use mandatory constructor parameters; `injectable` resolves them.
- **Test Mocks**: Swap implementations in `setUp` using `getIt.registerLazySingleton` for testing.
## Reference & Examples
For module configuration and initialization templates:
See [references/REFERENCE.md](references/REFERENCE.md).
## Related Topics
layer-based-clean-architecture | testing