mobile_scanner icon indicating copy to clipboard operation
mobile_scanner copied to clipboard

API for Permission Handling

Open p0wl90 opened this issue 2 years ago • 4 comments

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:

  1. I have a full-screen QR scanner view
  2. The user opens it for the first time and does not grant the app permission to use the camera
  3. 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 avatar Mar 16 '22 08:03 p0wl90

@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.

tim-teacher avatar Mar 29 '22 08:03 tim-teacher

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.

p0wl90 avatar Mar 29 '22 09:03 p0wl90

@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

janwol avatar Apr 22 '22 17:04 janwol

Yes, this is a must needed thing for the library

adar2378 avatar Sep 13 '22 12:09 adar2378

This is all present in the latest version 3.0.0-beta.4

juliansteenbakker avatar Dec 13 '22 20:12 juliansteenbakker