Extremely simple, fast and clear Dependency Injection (DI) and Inversion of Control (IOC) container.
- Helping resolving dependencies initialisation order easily
- Pure Dart library, no Flutter dependency
- Dependency Injection by explicit Type or by Interface
- "Lazy" instantiating
- Singletons and Multiple dependencies (see [getAll] for details)
- Resolution context with current dependency tree for automatic loggers definition and similar tasks
- Nested containers
- Easy debug: clear errors messages about missing dependencies with exact dependency tree description
Simply add as a dependency in pubspec.yaml
Please follow to /example
folder for simple console application template example.
final di = DI();
di
..bind(to: (c) => createLogger(c.plan[c.plan.length - 2]), dynamic: true)
..bind(to: (c) => AppConfig)
..bind(to: (c) => AppController(appConfig: c.get(), logger: c.get()));