injectable
injectable copied to clipboard
Dependency cannot be resolved if referenced by group import file
Hi, today added injectable to the project for the first time and I have to say that this lib is pure gold!
In the meantime I've stumbled across the issue when trying to use injectable class which is referenced through the intermediary bulk export file.
For example there is a class:
@singleton
class Http {
}
which is exported through index.dart like:
export 'http.dart';
and then using it as a dependency for another class:
import 'package:app/core/services/index.dart';
@injectable
class UserRepository {
final Http _http;
UserRepository(this._http) : assert(_http != null);
}
During generation I'm getting error "[UserRepository] depends on unregistered type [Http]" and config file looks like this:
gh.factory<UserRepository>(() => UserRepository(get()));
// Eager singletons must be registered in the right order
gh.singleton<WndHttp>(WndHttp());
If file is referenced directly everything is fine.
That issue made package unusable for me
I'm also facing this issue :/