registerWorker method Null safety

void registerWorker(
  1. String key,
  2. IsolateWorkersCreator creator
)

Implementation

void registerWorker(String key, IsolateWorkersCreator creator) {
  final workers = creator();
  final workerRegisteredTypes = <Type>[];

  for(final worker in workers) {
    _freeWorkers[worker.runtimeType] = worker;
    workerRegisteredTypes.add(worker.runtimeType);
  }

  _isolatedConnector.sendEvent(IsolateWorkersRegisteredEvent(key, workerRegisteredTypes));
}