title: Create rounded cached image in Flutter
body: <p>I want to create a circle image where the image is fetched from the network and is also cached in Flutter.</p>
  
  <p>Here is a code I found for a round image fetched from the network but the image not being cached.</p>
  
  <pre><code>new Container(
      width:80.0,
      height: 80.0,
      decoration: new BoxDecoration(
      shape: BoxShape.circle,
          image: new DecorationImage(
              image: new NetworkImage('https://pbs.twimg.com/profile_images/945853318273761280/0U40alJG_400x400.jpg'),
          ),
      ),
  ),
  </code></pre>
  
  <p>Now I found a widget for fetching, caching and presenting a image from the network </p>
  
  <pre><code>new CachedNetworkImage(imageUrl: 'https://pbs.twimg.com/profile_images/945853318273761280/0U40alJG_400x400.jpg')
  </code></pre>
  
  <p>But when I replace the NetworkImage widget with this CachedNetworkImage, it gives me an error saying the NetworkImage is not type image. </p>
  
  <p>How can I achieve a round image that can be cached?</p>
  
  <p>Edited:
  I tried this as suggested in the answer, but still got the same error: The argument type 'CachedNetworkImage' can't be assigned to the parameter type 'DecorationImage'.</p>
  
  <pre><code>              decoration: new BoxDecoration(
                  shape: BoxShape.circle,
                  image: new CachedNetworkImage(image: 
                        'https://pbs.twimg.com/profile_images/945853318273761280/0U40alJG_400x400.jpg'),
                ),
  </code></pre>