callServiceExtension method

Future<Response> callServiceExtension(
  1. String method, {
  2. String? isolateId,
  3. Map<String, dynamic>? args,
})

Invoke a specific service protocol extension method.

See https://api.dart.dev/stable/dart-developer/dart-developer-library.html.

Implementation

Future<Response> callServiceExtension(String method,
    {String? isolateId, Map<String, dynamic>? args}) {
  if (args == null && isolateId == null) {
    return _call(method);
  } else if (args == null) {
    return _call(method, {'isolateId': isolateId!});
  } else {
    args = Map.from(args);
    if (isolateId != null) {
      args['isolateId'] = isolateId;
    }
    return _call(method, args);
  }
}