Jermaine McFarlane

ensure permanent instances are replaced

... ... @@ -131,8 +131,11 @@ extension Inst on GetInterface {
/// Replace a parent instance of a class in dependency management
/// with a [child] instance
void replace<P, C extends P>(C child, {String? tag, bool permanent = false}) {
delete<P>();
/// - [tag] optional, if you use a [tag] to register the Instance.
void replace<P, C extends P>(C child, {String? tag}) {
final info = GetInstance().getInstanceInfo<P>(tag: tag);
final permanent = (info.isPermanent ?? false);
delete<P>(tag: tag, force: permanent);
// ignore: unnecessary_cast
put(child as P, tag: tag, permanent: permanent);
}
... ...