sharedObject property

O get sharedObject

The SharedObject (O) of this instance. This SharedObject will be automatically shared among Isolate copies.

See isAuxiliaryInstance, isResolvingReference and sharedObjectAsync.

Implementation

O get sharedObject {
  _setupInstance();

  var o = _sharedObjectExpando[this];
  if (o == null) {
    if (_resolvingReference) {
      throw StateError(
          "Trying to get `sharedObject` before it's resolved. See `isResolvingReference` and `sharedObjectAsync`.");
    } else {
      throw StateError(
          "After `_setupInstance`, `sharedObject` should be defined at `_sharedStoreExpando` (resolvingReference: $_resolvingReference)");
    }
  }

  return o as O;
}