title: Flutter web with Firebase Hosting can not load pictures from storage
body: <p>I'm developing a flutter web application and when I run it on the debug mode (local host) it works as a charm, my firestore requests works and storage urls too, but when I deploy it to Firebase Hosting, I can't load the pictures using the url from storage. This is what I get:</p>
  <blockquote>
  <p>Access to fetch at
  'https://firebasestorage.googleapis.com/v0/b/url-to-my-picture/?token=firestorage-key'
  from origin 'https://my-project.web.app' has been blocked by CORS
  policy: No 'Access-Control-Allow-Origin' header is present on the
  requested resource. If an opaque response serves your needs, set the
  request's mode to 'no-cors' to fetch the resource with CORS disabled.</p>
  </blockquote>
  <p>I searched for this and I got that I needed to set up my hosting on the firebase.json file and this is what I've done on the hosting section:</p>
  <pre><code>  &quot;hosting&quot;: {
      &quot;public&quot;: &quot;build/web&quot;,
      &quot;ignore&quot;: [
        &quot;firebase.json&quot;,
        &quot;**/.*&quot;,
        &quot;**/node_modules/**&quot;
      ],
      &quot;rewrites&quot;: [
        {
          &quot;source&quot;: &quot;**&quot;,
          &quot;destination&quot;: &quot;/index.html&quot;
        }
      ],
      &quot;headers&quot;: [
        {
          &quot;source&quot;: &quot;**&quot;,
          &quot;headers&quot;: [
            {
              &quot;key&quot;: &quot;Access-Control-Allow-Origin&quot;,
              &quot;value&quot;: &quot;*&quot;
            }
          ]
        }
      ]
    },
  </code></pre>
  <p>But no success. Note that I'm only using Flutter Web and the Firebase itself. No NodeJs, no php.</p>
  <p>EDIT:
  This is how I load the picture:</p>
  <pre><code>...
  NetworkImage(
      pic.url,
  ),
  ...
  </code></pre>