disposeSharedObject<T extends ReferenceableType> static method
T?
disposeSharedObject<T extends ReferenceableType>(
Removes and returns a T
ReferenceableType with id
.
Implementation
static T? disposeSharedObject<T extends ReferenceableType>(String id) {
var t = T;
var instances = (_typesInstances[t] ??= <String, WeakReference<T>>{})
as Map<String, WeakReference<T>>;
var o = instances.remove(id)?.target;
return o;
}