mobile_scanner
mobile_scanner copied to clipboard
API for Permission Handling
Hey! I hope that I'm not missing something but as far as I see it, there is currently no possibility to react to permission-issues. This would be good for the following use case:
- I have a full-screen QR scanner view
- The user opens it for the first time and does not grant the app permission to use the camera
- In that case, I want to close the view and display a dialog that tells users that they cannot use that view without granting the camera permission.
Thanks!
@p0wl90 I don't think it is correct to add Permission Handling api to scan lib. You can use any of tons such libs in pub.dev to handle it, not every one will use it, so it better keep lib small and clean.
You're right, I was used to this because my previous package supported this but actually, it is out of scope for a QR scanner. Still, maybe it makes sense to have some indicator or way to react if the permissin is missing.
@tim-teacher throwing the exception, if something went wrong, would be very helpful (for web): https://github.com/juliansteenbakker/mobile_scanner/blob/bbf4d5855d6e75295c44826a811cba72ea9bab7c/lib/src/mobile_scanner_controller.dart#L167-L175
Yes, this is a must needed thing for the library
This is all present in the latest version 3.0.0-beta.4