Implementation
void upload(SMHTaskInfo info, SendPort sendPort) {
SMHApiTransferApis().uploadTask(
info.libraryId,
info.spaceId,
info.userId,
info.body,
info.filePath,
info.length,
(result, error) {
sendPort.send({'code': 'finish', 'result': result, 'error': error});
},
userToken: info.userToken,
orgId: info.orgId,
slice: info.slice,
enableVerification: info.enableVerification,
confirmKey: info.confirmKey,
cancelToken: info.cancelToken,
confirmKeyCalBack: (confirmKey) {
sendPort.send({
'code': 'confirmKey',
'result': confirmKey,
'error': null,
});
},
conflictResolutionStrategy: info.conflictResolutionStrategy,
onSendProgress: (int count, int total) {
sendPort.send({
'code': 'processing',
'result': {'count': count, 'total': total},
'error': null
});
});
}