getObject method

Future<Obj> getObject(
  1. String isolateId,
  2. String objectId, {
  3. int? offset,
  4. int? count,
  5. String? idZoneId,
})

The getObject RPC is used to lookup an object from some isolate by its id.

If objectId is a temporary id which has expired, then the Expired Sentinel is returned.

If isolateId refers to an isolate which has exited, then the Collected Sentinel is returned.

If objectId refers to a heap object which has been collected by the VM's garbage collector, then the Collected Sentinel is returned.

If objectId refers to a non-heap object which has been deleted, then the Collected Sentinel is returned.

If the object handle has not expired and the object has not been collected, then an Obj will be returned.

The offset and count parameters are used to request subranges of Instance objects with the kinds: String, List, Map, Set, Uint8ClampedList, Uint8List, Uint16List, Uint32List, Uint64List, Int8List, Int16List, Int32List, Int64List, Float32List, Float64List, Inst32x3List, Float32x4List, and Float64x2List. These parameters are otherwise ignored.

If idZoneId is provided, temporary IDs for InstancesRef and Instances in the RPC response will be allocated in the specified ID zone. If idZoneId is omitted, ID allocations will be performed in the default ID zone for the isolate. See IDs and Names for more information about ID zones.

This method will throw a SentinelException in the case a Sentinel is returned.

Implementation

Future<Obj> getObject(
  String isolateId,
  String objectId, {
  int? offset,
  int? count,
  String? idZoneId,
}) =>
    _call('getObject', {
      'isolateId': isolateId,
      'objectId': objectId,
      if (offset != null) 'offset': offset,
      if (count != null) 'count': count,
      if (idZoneId != null) 'idZoneId': idZoneId,
    });