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

Cancel throws exception #1

Closed
ralph-bergmann opened this issue May 15, 2023 · 4 comments
Closed

Cancel throws exception #1

ralph-bergmann opened this issue May 15, 2023 · 4 comments

Comments

@ralph-bergmann
Copy link

When the user cancels a scan, an exception is thrown. I'm unsure if this is good behavior because canceling is an allowed operation and should not throw an exception.

see https://github.com/roman-yerin/native_qr/blob/trunk/android/src/main/kotlin/team/ion/native_qr/NativeQrPlugin.kt#L40

@ralph-bergmann
Copy link
Author

At least you should make a difference between a canceled scan and a scan with a failure. Currently, both are throwing an exception, and both have the same message "canceled".

@roman-yerin
Copy link
Owner

roman-yerin commented May 15, 2023

That's because of the oversimplified Flutter plugin interface.

Currently, both are throwing an exception, and both have the same message "canceled".

You're right.

@ralph-bergmann
Copy link
Author

At least with Pigeon you can implement some return Types like: ScanResult, ScanCanceld and ScanFailure.

@roman-yerin
Copy link
Owner

Thanks for your suggestion, Ralph, I appreciate it.
As some people asked to implement barcodes and non-string raw QR codes, your proposal is highly likely a step into the same way.

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