poolTrackResults method Null safety

Future<TrackingData> poolTrackResults()

Implementation

Future<TrackingData> poolTrackResults() async {
  ReceivePort receivePort = ReceivePort();
  TrackingData result = TrackingData();

  _sendPort.send({
    "event": _VideoWorkerEvents.POOL_TRACK_RESULTS,
    "sendPort": receivePort.sendPort,
  });

  Map<String, dynamic> data = await receivePort.first;

  result.tracking_callback_data = _parseTrackingCallbackData(data["tracking_callback_data"]);
  result.template_created_callback_data = _parseTemplateCreatedCallbackData(data["template_created_callback_data"]);
  result.tracking_lost_callback_data = _parseTrackingLostCallbackData(data["tracking_lost_callback_data"]);
  result.tracking_match_found_callback_data = _parseTrackingMatchFoundCallbackData(data["tracking_match_found_callback_data"]);
  result.sti_person_outdated_callback_data = _parseStiPersonOutdatedCallbackData(data["sti_person_outdated_callback_data"]);

  return result;
}