upload method

Future<PixelBinImage?> upload(
  1. File file,
  2. SignedDetails signedDetails, {
  3. int chunkSize = 1024,
  4. int concurrency = 1,
})

Implementation

Future<PixelBinImage?> upload(File file, SignedDetails signedDetails,
    {int chunkSize = 1024, int concurrency = 1}) async {
  if (signedDetails.url.contains("storage.googleapis.com")) {
    return await uploadToGCS(
      signedDetails.url,
      signedDetails.fields,
      file,
    );
  } else if (signedDetails.url.contains("api.pixelbin")) {
    return await multipartFileUpload(
        file, signedDetails, chunkSize, concurrency);
  } else {
    return await uploadToS3(
      signedDetails.url,
      signedDetails.fields,
      file,
    );
  }
}