Failed to load network image in flutter web

Viewed 499

I am trying to retrieve a network image from firebase and I found the below error:

Failed to load network image.
Image URL: https://firebasestorage.googleapis.com/v0/b/my-portfolio-e615c.appspot.com/o/user%2FIMG_7344.jpg?alt=media&token=e7681a94-89f3-4a85-b8f8-83f346e91bd8
Trying to load an image from another domain? Find answers at:
https://flutter.dev/docs/development/platform-integration/web-images

So I searched about the solution I found I can use one of the below commands and it works fine:

flutter run --web-renderer html

flutter build web --release --web-renderer html

So is there's another solution to run on debug mode without showing this error?

1 Answers

I believe the issue is related to Cross Origin Resource Sharing, and in Flutter there is a good explanation here. It gives specific examples for how to configure Firebase cross origin requests by modifying your firebase.json file.

Related