replace<P> method
Replace a parent instance of a class in dependency management
with a child
instance
tag
optional, if you use atag
to register the Instance.
Implementation
void replace<P>(P child, {String? tag}) {
final InstanceInfo info = getInstanceInfo<P>(tag: tag);
final bool permanent = info.isPermanent ?? false;
delete<P>(tag: tag, force: permanent);
put(child, tag: tag, permanent: permanent);
}