title: How to avoid app crash when picking a image with flutter and image_picker package?
body: <p>I'm building a application for taking photos and send them into firestore, i'm using image_picker :0.5.0+8 when I'm trying to pick a image from camera or from gallery the app crash. it open gallery very well or the camera very well but if a choose a picture the app crash. </p>
  
  <p>this is my code:</p>
  
  <blockquote>
    <p>File image_state;   AppState state;</p>
    
    <p>bool isLoading;   bool isShowSticker;   String _imageUrl;</p>
    
    <p>Future getImage() async {
        var tempImage = await ImagePicker.pickImage(source: ImageSource.gallery);</p>
  
  <pre><code>setState(() {
    image_state = tempImage;
    state = AppState.picked;
  });
  
  File croppedFile = await ImageCropper.cropImage(
    sourcePath: image_state.path,
    ratioX: 1.0,
    ratioY: 1.0,
    toolbarTitle: 'Cropper',
    toolbarColor: Colors.blue,
  );
  if (croppedFile != null) {
    image_state = croppedFile;
    setState(() {
      state = AppState.cropped;
    });
  }   }
  </code></pre>
  </blockquote>
  
  <p>is there some one who work with this librairy? can you show me an example that work please?</p>