uploadFile method
Implementation
@override
Future<String> uploadFile(
String localFilePath,
String remoteFilePath,
) async {
try {
final file = File(localFilePath);
final data = await file.readAsBytes();
final ref = _storage.ref(remoteFilePath);
final uploadTask = ref.putData(data);
final snapshot = await uploadTask;
final downloadUrl = await snapshot.ref.getDownloadURL();
return downloadUrl;
} catch (e) {
debugPrint(
'Error uploading file from [$localFilePath] to [$remoteFilePath] due to [$e]');
rethrow;
}
}