Navaron Bracke

fix check for permission state

... ... @@ -45,7 +45,7 @@ class MobileScannerPermissions {
return if (hasPermission) {
1
} else {
0
2
}
}
... ...
... ... @@ -189,8 +189,9 @@ class MobileScannerController {
final MobileScannerState state;
try {
state = MobileScannerState
.values[await _methodChannel.invokeMethod('state') as int? ?? 0];
state = MobileScannerState.fromRawValue(
await _methodChannel.invokeMethod('state') as int? ?? 0,
);
} on PlatformException catch (error) {
isStarting = false;
... ...