Scenario : I am downloading image/video files from firebase storage and displaying them in a list.
Issue : The response is pretty slow. It is taking way too much time to download images/videos.
CODE :
Directory tempDir = await getTemporaryDirectory();
final File tempFile = File('${tempDir.path}/$fileName');
if(tempFile.existsSync()){
await tempFile.delete();
}
await tempFile.create();
var ref = FirebaseStorage.instance.ref(path);
// final DownloadTask task = ref.writeToFile(tempFile);
final DownloadTask task = ref.writeToFile(tempFile);
await task.then((value) => {
file = tempFile
//Also delete the temp file
// await tempFile.delete();
});
RESULT : The files gets download successfully but response is way too much long. Any suggestions on how to make downloads faster. I also tested the response on real device with a release apk but still way too much slow downloading from Firebase Storage. I am using internet connection of 20MBPS so it's pretty decent speed to download data. Also, the uploading of files to firebase storage is pretty decent and i haven't found any issues there.
NOTE : I am currently using Firebase Free plan for development. Is that affecting the download response ? Really need some experts advice here.