sftpDownload method

Future<String?> sftpDownload({
  1. required String path,
  2. required String toPath,
  3. Callback? callback,
})

Downloads the specified file using SFTP.

var filePath = await client.sftpDownload(
  path: "testfile",
  toPath: tempPath,
  callback: (progress) {
    print(progress); // read download progress
  },
);

Implementation

Future<String?> sftpDownload({
  required String path,
  required String toPath,
  Callback? callback,
}) async {
  downloadCallback = callback;
  var result = await _channel.invokeMethod('sftpDownload', {
    "id": id,
    "path": path,
    "toPath": toPath,
  });
  return result;
}