Open jsleemaster opened 2 weeks ago
This getter is defined here: https://github.com/juliansteenbakker/mobile_scanner/blob/master/lib/src/objects/mobile_scanner_state.dart#L66
What version of mobile_scanner
are you using? The getter was introduced in version 6.0.0, as stated in the changelog.
https://github.com/juliansteenbakker/mobile_scanner/blob/master/CHANGELOG.md#600
If you do not want to upgrade to that version, you can just do the check yourself, too.
For that, you'll need to check both isInitialized
and error?.errorCode != MobileScannerErrorCode.permissionDenied
Hello @navaronbracke I same issue! I has check code, default isInitialized is false => hasCameraPermission is false and isInitialized set is true when call start() please fix this issue
@hailuongsl97 What version of mobile_scanner
are you using? The getter hasCameraPermission
is introduced in version 6.0.0, with a workaround for version 5.0.0, as stated above.
@hailuongsl97 What version of
mobile_scanner
are you using? The getterhasCameraPermission
is introduced in version 6.0.0, with a workaround for version 5.0.0, as stated above.
I use mobile_scanner v 6.0.2
@hailuongsl97 I do not understand what problem your are encountering? You can use hasCameraPermission
in didChangeAppLifecycleState
, to determine if the controller should be started when the application is resumed.
See the example at https://github.com/juliansteenbakker/mobile_scanner/blob/master/example/lib/barcode_scanner_controller.dart#L62-L81
Or are you referring to a different issue?
Error
The getter 'hasCameraPermission' isn't defined for the type 'MobileScannerState'. Try importing the library that defines 'hasCameraPermission', correcting the name to the name of an existing getter, or defining a getter or field named 'hasCameraPermission'.
There is an error with the hasCameraPermission option in the idChangeAppLifeState method part in the official document. Which part should it be replaced with? Can you correct it?
Currently, I am checking with isInitialized option.