Flutter 图像裁剪器不显示要裁剪的图像

Flutter image cropper not showing image to be cropped

我设法使用图片选择器从图库中选择了一张图片,如下所示

Future pickImage() async {
File _originalImage = await ImagePicker.pickImage(
    source: ImageSource.camera);
if (_originalImage != null) {
  File _croppedImage = await ImageCropper.cropImage(
      sourcePath: _originalImage.path,
      aspectRatioPresets: [
        CropAspectRatioPreset.square,
        CropAspectRatioPreset.ratio3x2,
        CropAspectRatioPreset.original,
        CropAspectRatioPreset.ratio4x3,
        CropAspectRatioPreset.ratio16x9
      ],

      androidUiSettings: AndroidUiSettings(
          toolbarColor: BaengColors.blue,
          toolbarTitle: 'Baeng Omang Cropper',
          statusBarColor: BaengColors.blue[700],
          initAspectRatio: CropAspectRatioPreset.original,
          lockAspectRatio: false
      )
  );
   this.setState(() {
     _imagePicked = _croppedImage;
     isLoaded = true;
     getTextFromImage();
    });
   } 
  }

尝试调试了几次,它没有显示出任何错误或问题,但是图像裁剪 activity 仍然是黑色(没有)从图像选择器中选择的图像。

请帮忙

只需在Image_Picker

中添加maxHeight和maxWidth
File  _originalImage = await ImagePicker.pickImage(source: ImageSource.camera, 
imageQuality: 20,
maxHeight: 500,maxWidth: 500);