resolveAll<T> method
Resolves all registered implementations of a given type.
Note: This implementation has a bug - it tries to resolve T for all registered types, which will likely fail. This should be fixed to properly resolve all implementations that are assignable to T.
Implementation
@override
List<T> resolveAll<T>() {
final List<T> result = [];
// Resolve the main binding if it exists
if (_bindings.containsKey(T) || _instances.containsKey(T)) {
result.add(resolve<T>());
}
// Resolve all contextual bindings for T
for (final context in _contextualBindings.keys) {
if (_contextualBindings[context]!.containsKey(T)) {
result.add(resolve<T>(context));
}
}
return result;
}