closeWorker method Null safety

void closeWorker(
  1. String id
)

Implementation

void closeWorker(String id) {
  assert(
    _createdWorkers.containsKey(id),
    'You are trying to remove worker with with a nonexistent id($id).\n'
        'This can happen if you call close() twice.',
  );
  _createdWorkers.remove(id)?.close();
}