'Flutter Web not correctly uploading image to Firebase Storage
I am currently developing a Flutter Web application and am attempting to use Firebase Storage to store images. I used the below code to upload the image to Firebase Storage:
TaskSnapshot snapshot = await FirebaseStorage.instance.ref().child("playerAvatars/$playerId.jpg").putData(image!);
final downloadUrl = await snapshot.ref.getDownloadURL();
However when I attempt to view the image in Firebase Storage I do no see a preview as I typically would. Additionally, when I click on the image url, my computer automatically downloads the image instead of showing it online with my search engine.
Finally, when I attempt to show the image on my application as a Network Image I get the following error:
Failed to load network image.
Image URL: https://firebasestorage.googleapis.com/v0/b/games-4a8f5.appspot.com/o/playerAvatars%2Fb63JGzQtOkYGigdHEOLM.jpg?alt=media&token=af3b0db5-9be6-492b-b6b3-3ead346f1c49
I believe this is because the image seems to only be downloadable and cannot be used as network image however I would very much appreciate help in making it a network image so I can present it in the app without having to download it and store it in memory.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

