withScope method
Defines the type of scope this pod belongs to (e.g., singleton,
prototype).
singleton: one shared instance across the container.prototype: a new instance each time it is requested.
Example
spec.withScope(ScopeType.singleton);
Implementation
@override
Spec<T> withScope(ScopeType type) {
_root.scope = ScopeDesign(
type: type.name,
isSingleton: type == ScopeType.SINGLETON,
isPrototype: type == ScopeType.PROTOTYPE,
);
return this;
}