title: base64encode image from camera flutter
body: <p>i am trying to encode image to base64 to send to server. the base 64 string i am getting from image is not valid.</p>
  
  <p>i can display image captured from camera. its not encoding to base64 properly.</p>
  
  <pre><code>File img;
   void getPic() async {
      img = await ImagePicker.pickImage(source: ImageSource.camera);
      if (img != null) {
        print(img);
        List&lt;int&gt; imageBytes = await img.readAsBytes();
        base64Image =  base64Encode(imageBytes);
        print(base64Image);
        setState(() =&gt; base64Image);
      }
    }
  </code></pre>