title: Flutter image_picker post upload an image
body: <p>I am using the Flutter Plugin Image_picker to choose images so that I want to upload image after selected the image</p>
  
  <pre><code>Future&lt;File&gt; _imageFile;
  
    void _onImageButtonPressed(ImageSource source) async {
      setState(() {
        _imageFile = ImagePicker.pickImage(source: source);
      });
    }
  </code></pre>
  
  <p>I find this code in <a href="https://www.dartdocs.org/documentation/http/0.11.3%2B16/http/MultipartRequest-class.html" rel="nofollow noreferrer">flutter documentation</a> but its not work </p>
  
  <pre><code>var uri = Uri.parse("http://pub.dartlang.org/packages/create");
  var request = new http.MultipartRequest("POST", url);
  request.fields['user'] = 'nweiz@google.com';
  request.files.add(new http.MultipartFile.fromFile(
      'package',
      new File('build/package.tar.gz'),
      contentType: new MediaType('application', 'x-tar'));
  request.send().then((response) {
    if (response.statusCode == 200) print("Uploaded!");
  });
  </code></pre>