replace<P> method
Replace a parent instance of a class in dependency management
with a child instance
tagoptional, if you use atagto register the Instance.
Implementation
void replace<P>(P child, {String? tag}) {
final info = getInstanceInfo<P>(tag: tag);
final permanent = (info.isPermanent ?? false);
final factory = _typeSingl[P]?[tag];
if (factory != null) {
_deleteFactory(factory, force: permanent, keepFactory: false);
}
put<P>(child, tag: tag, permanent: permanent);
}