uploadUserScreenshotToFirebase method
uploadUserScreenshotToFirebase is function used for uploading the taken screenshot to the Firebase Storage.
Implementation
Future<String> uploadUserScreenshotToFirebase({
required String filePath,
required String imagePath,
required String imageName,
}) async {
File file = File(filePath);
try {
await firebase_storage.FirebaseStorage.instance
.ref('$imagePath/$imageName.png')
.putFile(file);
String downloadURL = await firebase_storage.FirebaseStorage.instance
.ref('$imagePath/$imageName.png')
.getDownloadURL();
return downloadURL;
} on firebase_core.FirebaseException {
rethrow;
}
}