dependon 0.0.1 dependon: ^0.0.1 copied to clipboard
Dependency injection management.
import 'package:dependon/dependon.dart';
import 'provider/user_provider.dart';
import 'repository/user_repository.dart';
import 'repository/user_repository_impl.dart';
void main() async {
singleton(() => UserProvider());
singleton<UserRepository>(() => UserRepositoryImpl(get()));
final UserRepository userRepository = get();
final user = await userRepository.getUser();
print(user.name);
}