title: How to Save set image of PickedFile type to a image in Flutter?
body: <p>I want to set get image from the camera and set it to the following code:</p>
  
  <pre><code>image: DecorationImage(image: FileImage(file),
  </code></pre>
  
  <p>So I did this: </p>
  
  <pre><code>File file = await ImagePicker.pickImage(
    source: ImageSource.camera,
  );
  </code></pre>
  
  <p>Now above code works fine for now, but 'pickImage' is deprecated and we should use imagePicker.getImage() method instead.</p>
  
  <p>So I used imagePicker.getImage() instead:</p>
  
  <pre><code>PickedFile file = await ImagePicker().getImage(
    source: ImageSource.camera,
  );
  </code></pre>
  
  <p>But when I try to set this file to the following image type, it doesn't work</p>
  
  <pre><code>image: DecorationImage(image: FileImage(file),)
  </code></pre>
  
  <p>How to solve this issue?</p>