title: How to post asset image to server using MultipartFile in flutter
body: <p>I am using <code>MultipartFile</code> to send my image file to server. I know that when I use <code>ImagePicker</code></p>
  
  <pre><code>File ImageFile;
  
    _openCamera() async {
      var picture = await ImagePicker.pickImage(source: ImageSource.camera);
      this.setState(() {
        imageFile = picture;
      });
    }
  </code></pre>
  
  <p>then use <code>MultipartFile</code> like this</p>
  
  <pre><code>request.files.add(http.MultipartFile.fromBytes('img', ImageFile.readAsBytesSync(), filename: 'photo.jpg'));
  </code></pre>
  
  <p>But my problem is I want my image is from my <strong>assets</strong> like from here <code>Image.asset('images/photo1.png');</code>. I have error</p>
  
  <pre class="lang-none prettyprint-override"><code>A value of type 'Image' can't be assigned to a variable of type 'File'.
  Try changing the type of the variable, or casting the right-hand type to 'File'.
  </code></pre>
  
  <p>So, my question is how I can send my image using <code>MultipartFile</code> method?</p>