uploadFile method

  1. @override
Future<Map<String, FileTransferObject>> uploadFile(
  1. List<File> files,
  2. List<String> sharedWithAtSigns
)
override

Uploads list of files to filebin and shares the file download url with sharedWithAtSigns returns map containing key of each sharedWithAtSign and value of FileTransferObject

Implementation

@override
Future<Map<String, FileTransferObject>> uploadFile(
    List<File> files, List<String> sharedWithAtSigns) async {
  var encryptionKey = _encryptionService!.generateFileEncryptionKey();
  var key = TextConstants.fileTransferKey + Uuid().v4();
  var fileStatus = await _uploadFiles(key, files, encryptionKey);
  // ignore: prefer_interpolation_to_compose_strings
  var fileUrl = TextConstants.fileBinURL + 'archive/' + key + '/zip';

  return shareFiles(
      sharedWithAtSigns, key, fileUrl, encryptionKey, fileStatus);
}