bindWhen<T> method
Binds an implementation to an interface when requested within a specific context.
Allows different implementations of the same interface to be used in different contexts. The context is specified during resolution.
T - The abstract type to bind
context - The context identifier for this binding
factory - Factory function that creates the instance
singleton - Whether to cache and reuse the instance
Implementation
@override
void bindWhen<T>(
String context,
dynamic Function(ContainerInterface) factory, {
bool singleton = false,
}) {
_contextualBindings[context] ??= {};
_contextualBindings[context]![T] = _Binding(factory, singleton: singleton);
}