disposeSharedObject<T extends ReferenceableType> static method

T? disposeSharedObject<T extends ReferenceableType>(
  1. String id
)

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;
}