downloadFile function Null safety

void downloadFile(
  1. SMHTaskInfo info,
  2. SendPort sendPort
)

Implementation

void downloadFile(SMHTaskInfo info, SendPort sendPort) {
  SMHApiTransferApis().downloadTask(
    info.libraryId,
    info.spaceId,
    info.userId,
    info.localPath,
    info.filePath,
    (result, error) {
      sendPort.send({'code': 'finish', 'result': result, 'error': error});
    },
    userToken: info.userToken,
    orgId: info.orgId,
    enableVerification: info.enableVerification,
    offset: info.offset,
    cancelToken: info.cancelToken,
    onReceiveProgress: (int count, int total) {
      sendPort.send({
        'code': 'processing',
        'result': {'count': count, 'total': total},
        'error': null
      });
    },
  );
}