Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call up the camera, go to crop, then cancel, no callbacks #32

Open
levicn opened this issue May 23, 2024 · 1 comment
Open

Call up the camera, go to crop, then cancel, no callbacks #32

levicn opened this issue May 23, 2024 · 1 comment

Comments

@levicn
Copy link

levicn commented May 23, 2024

    try {
        final HLPickerItem item = await _hlPicker.openCamera(
          cameraOptions: const HLCameraOptions(
            cameraType: CameraType.image,
          ),
          cropping: true,
          cropOptions: const HLCropOptions(
            aspectRatioPresets: [CropAspectRatioPreset.original, CropAspectRatioPreset.square],
            compressFormat: CompressFormat.jpg,
            compressQuality: .8,
          ),
          localized: LocalizedImageCropper(
              cropDoneText: R.string.selectImageDone,
              cropCancelText: R.string.selectImageCancel,
              cropTitleText: R.string.cropImage
          ),
        );
        _pickCompleted([item]);
      } catch(e) {
        if (e is PlatformException) {
          if (e.code == 'CANCELED') {
            
          }
        }
        formatPrint(e);
      }

If canceled directly after cropping, the part after await will not be executed

@howljs
Copy link
Owner

howljs commented May 23, 2024

I missed the cancel case. Currently, I don’t have the time. I will try to find time to update it soon. If you can fix it right away, you can create a pull request, and I will merge and publish the new version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants