create method Null safety

Future<AsyncVideoWorker> create(
  1. Pointer<Void> implementation,
  2. String facerecConfDir,
  3. String dllPath,
  4. VideoWorkerParams params
)

Implementation

static Future<AsyncVideoWorker> create(Pointer<Void> implementation, String facerecConfDir, String dllPath, VideoWorkerParams params) async {
  ReceivePort receivePort = ReceivePort();

  Isolate isolate = await Isolate.spawn(_isolateImplementation, {
    "implementation": implementation.address,
    "facerecConfDir": facerecConfDir,
    "dllPath": dllPath,
    "sendPort": receivePort.sendPort,
    "_recognizer_ini_file": params._recognizer_ini_file,
    "_streams_count": params._streams_count,
    "_processing_threads_count": params._processing_threads_count,
    "_matching_threads_count": params._matching_threads_count,
    "_age_gender_estimation_threads_count": params._age_gender_estimation_threads_count,
    "_emotions_estimation_threads_count": params._emotions_estimation_threads_count,
    "_short_time_identification_enabled": params._short_time_identification_enabled,
    "_short_time_identification_distance_threshold": params._short_time_identification_distance_threshold,
    "_short_time_identification_outdate_time_seconds": params._short_time_identification_outdate_time_seconds,
    "_active_liveness_checks_order": params._active_liveness_checks_order,
    "configFilepath": params._video_worker_config._configFilepath,
    "overriddenParams": params._video_worker_config._overriddenParams,
  });

  SendPort sendPort = await receivePort.first;

  return AsyncVideoWorker._create(isolate, sendPort, dllPath);
}