bindWhen<T> abstract method
Registers a contextual binding for type T under a specific context.
This allows different factories for T based on the context provided during resolution.
If singleton is true, the instance is created once per context and reused.
context: A string key identifying the context.factory: A function that takes the container and returns an instance ofT.singleton: If true, the factory is treated as a singleton within the context.
Throws an exception if a binding for T under the same context already exists.
Implementation
void bindWhen<T>(
String context,
dynamic Function(ContainerInterface) factory, {
bool singleton = false,
});