getInstances method

Future<InstanceSet?> getInstances(
  1. String classId,
  2. int limit, {
  3. bool? includeSubclasses,
})

Returns up to limit live instances of classId.

Returns null when heap enumeration is unavailable or the call fails. includeSubclasses includes instances of subclasses when the VM supports it.

Implementation

Future<InstanceSet?> getInstances(
  String classId,
  int limit, {
  bool? includeSubclasses,
}) async {
  _ensureConnected();
  if (!_supportsClassList) return null;
  try {
    return await _vmService!.getInstances(
      _isolateId!,
      classId,
      limit,
      includeSubclasses: includeSubclasses,
    );
  } catch (_) {
    return null;
  }
}