setAutoAttach method Null safety

Future<void> setAutoAttach(
  1. bool autoAttach,
  2. bool waitForDebuggerOnStart,
  3. {bool? flatten,
  4. TargetFilter? filter}

Controls whether to automatically attach to new targets which are considered to be related to this one. When turned on, attaches to all existing related targets as well. When turned off, automatically detaches from all currently attached targets. This also clears all targets added by autoAttachRelated from the list of targets to watch for creation of related targets. autoAttach Whether to auto-attach to related targets. waitForDebuggerOnStart Whether to pause new targets when attaching to them. Use Runtime.runIfWaitingForDebugger to run paused targets. flatten Enables "flat" access to the session via specifying sessionId attribute in the commands. We plan to make this the default, deprecate non-flattened mode, and eventually retire it. See filter Only targets matching filter will be attached.


Future<void> setAutoAttach(bool autoAttach, bool waitForDebuggerOnStart,
    {bool? flatten, TargetFilter? filter}) async {
  await _client.send('Target.setAutoAttach', {
    'autoAttach': autoAttach,
    'waitForDebuggerOnStart': waitForDebuggerOnStart,
    if (flatten != null) 'flatten': flatten,
    if (filter != null) 'filter': filter,