title: Flutter: CachedNetworkImage not caching image
body: <p>I have a widget that retrieves images from Firebase Storage. But now I want to cache these images, to make the user experience more neat (and also avoid unneccessary calls to Firebase).</p>
  
  <p>So I found CachedNetworkImageProvider which sounded like everything I wanted. I tried implementing it as stated in the docs, but it doesn't work and I can't figure out why.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>class FirebaseStorageImage extends StatelessWidget {
    final String fileName;
    final StorageReference storageLocation;
  
    FirebaseStorageImage(
        {@required this.fileName, @required this.storageLocation});
  
    Future&lt;String&gt; _getImageURL() async {
      final StorageReference ref = storageLocation.child(fileName + ".jpg");
  
      try {
        var url = await ref.getDownloadURL();
        return url;
      } catch (e) {
        return null;
      }
    }
  
    @override
    Widget build(BuildContext context) {
      return FutureBuilder(
        future: _getImageURL(),
        builder: (context, snapshot) {
          if (snapshot.connectionState == ConnectionState.done &amp;&amp;
              snapshot.hasData) {
            return Image(
              //image: NetworkImage(snapshot.data),
              image: CachedNetworkImageProvider(snapshot.data),
              fit: BoxFit.cover,
            );
          } else if (snapshot.connectionState == ConnectionState.waiting) {
            //RETURN THIS WHILE WAITING FOR IMAGE
            return Text("Waiting....");
          } else {
            //RETURN THIS IF NO IMAGE WAS FOUND AT THAT LOCATION
            return Image(
              image: AssetImage("assets/images/placeholder.png"),
              fit: BoxFit.cover,
            );
          }
        },
      );
    }
  }
  </code></pre>