uploadFile method

  1. @override
Future<String> uploadFile({
  1. required String localPath,
  2. required String remotePath,
  3. Map<String, dynamic>? metadata,
})
override

Uploads a file to the cloud storage.

Implementation

@override
Future<String> uploadFile({
  required String localPath,
  required String remotePath,
  Map<String, dynamic>? metadata,
}) async {
  if (!_isAuthenticated) {
    throw Exception('Not authenticated');
  }
  final file = File(localPath);
  final bytes = await file.readAsBytes();
  await client.push(bytes, remotePath,
      isAppFolder:
          MultiCloudStorage.cloudAccess == CloudAccessType.appStorage);
  return remotePath;
}