singleton<T> abstract method
Registers a singleton factory for type T.
The factory is called once, and the instance is reused for all subsequent resolutions. This is equivalent to calling bind with singleton set to true.
factory: A function that takes the container and returns an instance ofT.
Throws an exception if a binding for T already exists.
Implementation
void singleton<T>(dynamic Function(ContainerInterface) factory);