downloadFile method

  1. @override
Future<String> downloadFile({
  1. required String remotePath,
  2. required String localPath,
})
override

Downloads a file from the cloud storage.

Implementation

@override
Future<String> downloadFile({
  required String remotePath,
  required String localPath,
}) async {
  if (!_isAuthenticated) {
    throw Exception('Not authenticated');
  }

  final response = await client.pull(remotePath,
      isAppFolder:
          MultiCloudStorage.cloudAccess == CloudAccessType.appStorage);
  final file = File(localPath);
  await file.writeAsBytes(response.bodyBytes!);

  return localPath;
}