Skip to main content

Posts

Showing posts from April, 2021

How to get images from Firebase Cloud Storage to display in Flutter web

The Problem As I was updating the web version of my Shopping list app to look and function more like the mobile app version, I noticed that the images were not displaying. I would see error messages in the console telling me that it could not display the image. I thought that maybe it was because the widget CachedNetwokImage( ) doesn't work for the web so I changed to Network image but that didn't work either. The Solution  I found the solution in this  Stack Overflow  post. The issue was something called CORS. So if you are using flutter web and you want to display images that are not stored in the app itself but rather on a different server (like Firebase Cloud Storage) then you have to give permission for your app to display those images from the other server. The way you do that is through configuring a Cors.json file through the Google Cloud Platform.  I'm going to walk you through how I got the images stored in Firebase Cloud Storage to show up in my Flut