getInstances method Null safety

Future<InstanceSet> getInstances(
  1. String isolateId,
  2. String objectId,
  3. int limit
)

The getInstances RPC is used to retrieve a set of instances which are of a specific class. This does not include instances of subclasses of the given class.

The order of the instances is undefined (i.e., not related to allocation order) and unstable (i.e., multiple invocations of this method against the same class can give different answers even if no Dart code has executed between the invocations).

The set of instances may include objects that are unreachable but have not yet been garbage collected.

objectId is the ID of the Class to retrieve instances for. objectId must be the ID of a Class, otherwise an RPC error is returned.

limit is the maximum number of instances to be returned.

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

See InstanceSet.

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

Implementation

Future<InstanceSet> getInstances(
    String isolateId, String objectId, int limit);