upload method

Future<String?> upload(
  1. File file,
  2. String path, {
  3. bool? overwrite,
  4. void onProgressUpdate(
    1. int progress
    )?,
})

Implementation

Future<String?> upload(File file, String path,
    {bool? overwrite, void onProgressUpdate(int progress)?}) {
  Map<String, dynamic> args = <String, dynamic>{
    "filePath": file.path,
    "path": path,
    "overwrite": overwrite
  };

  if (onProgressUpdate != null) {
    int handle = _nextUploadHandle++;
    UploadCallback uploadCallback = new UploadCallback(onProgressUpdate);
    _uploadCallbacks[handle] = uploadCallback;
    args["handle"] = handle;
  }
  return _channel.invokeMethod("Backendless.Files.upload", args);
}