dependon 0.0.6 dependon: ^0.0.6 copied to clipboard
Simple, light-weight and extremely legible package for dependency injection management.
Simple, light-weight and extremely legible package for dependency injection management.
Features #
- Simple to use
- Light-weight and high compatible
- Keep your code legible
Getting started #
- Create your dependencies
import 'package:dependon/dependon.dart';
void main() {
final Dependon di = Dependon.instance;
di.registerLazySingleton<UserRepository>(() => UserRepositoryImpl());
di.registerFactory(() => UserUseCase(get()));
di.registerSingleton(UserService(get()));
runApp(myApp());
}
- Retrieve your dependencies
import 'package:dependon/dependon.dart';
final UserRepository userRepository = get<UserRepository>();
// or
final UserRepository userRepository = get();
// or
final userRepository = get<UserRepository>();
Additional information #
This is an alpha release and this package is still in development. Not recommended for ** production**.