Worker buildWorkerForScript(Map<String, dynamic> data)

Source

Worker buildWorkerForScript(Map<String, dynamic> data) {
  SendPort port;
  Map<String, dynamic> metadata;

  if (data["port"] is SendPort) {
    port = data["port"];
  }

  if (data["metadata"] is Map<String, dynamic>) {
    metadata = data["metadata"] as Map<String, dynamic>;
  }

  return new Worker(port, metadata);
}