just_di 1.0.0
just_di: ^1.0.0 copied to clipboard
Lightweight, framework-agnostic dependency injection for Dart with scoped containers.
Just DI #
A lightweight, framework-agnostic dependency injection package for Dart and Flutter.
Features #
- Global service registration
- Singleton, lazy singleton, and factory support
- Scoped overrides for tests and feature isolation
- Explicit reset and disposal behavior
Quick Start #
import 'package:just_di/just_di.dart';
final api = ApiClient();
JustDi.registerSingleton<ApiClient>(api);
final scope = JustDi.createScope();
scope.registerLazySingleton<AuthService>(() => AuthService(scope.get<ApiClient>()));
final auth = scope.get<AuthService>();
scope.close();