removeLiveStreamTask method Null safety

Future<int> removeLiveStreamTask(
  1. String taskId,
  2. DeleteLiveTaskCallback? callback
)

Deletes a streaming task. The operation is valid during a call

taskId live streaming task ID DeleteLiveTaskCallback operation result. The callback is triggered when the operation succeeds

Implementation

Future<int> removeLiveStreamTask(
    String taskId, DeleteLiveTaskCallback? callback) async {
  int serial = -1;
  if (callback != null) {
    serial = _onceEventHandler.addOnceCallback((args) {
      callback(args['taskId'], args['errCode']);
    });
  }
  IntValue reply =
      await _api.removeLiveStreamTask(DeleteLiveStreamTaskRequest()
        ..serial = serial
        ..taskId = taskId);
  return reply.value ?? -1;
}