Flutter Image object to ImageProvider : <p>I had to read my image source from base64 to flutter <a href="https://api.flutter.dev/flutter/widgets/Image-class.html" rel="noreferrer">Image</a> object.</p>

<pre class="lang-dart prettyprint-override"><code>Image img = Image.memory(base64Decode(BASE64_STRING));
</code></pre>

<p>and then i wanted to put the image as a Container background. But DecorationImage is only accepting <a href="https://api.flutter.dev/flutter/painting/ImageProvider-class.html" rel="noreferrer">ImageProvider</a>. </p>

<p>How to convert Image to ImageProvider? or is ther any other way to deliver base64 image to ImageProvider?</p>

<pre class="lang-dart prettyprint-override"><code>Container(
  decoration: BoxDecoration(
    color: Colors.green,
    image: DecorationImage(
      image: img // &lt;-- Expecting ImageProvider
    )
)
</code></pre>
