Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
mobile_scanner
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Navaron Bracke
2023-11-27 17:03:12 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5a2d63cb46273bcc1e75ac6251506adbc52842f0
5a2d63cb
1 parent
167b8388
apply Android permission fix again
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
lib/src/method_channel/mobile_scanner_method_channel.dart
lib/src/method_channel/mobile_scanner_method_channel.dart
View file @
5a2d63c
...
...
@@ -113,18 +113,17 @@ class MethodChannelMobileScanner extends MobileScannerPlatform {
}
switch
(
authorizationState
)
{
case
MobileScannerAuthorizationState
.
denied
:
throw
const
MobileScannerException
(
errorCode:
MobileScannerErrorCode
.
permissionDenied
,
);
case
MobileScannerAuthorizationState
.
authorized
:
return
;
// Already authorized.
// Android does not have an undetermined authorization state.
// So if the permission was denied, request it again.
case
MobileScannerAuthorizationState
.
denied
:
case
MobileScannerAuthorizationState
.
undetermined
:
try
{
final
bool
permissionResult
=
final
bool
granted
=
await
methodChannel
.
invokeMethod
<
bool
>(
'request'
)
??
false
;
if
(
permissionResult
)
{
if
(
granted
)
{
return
;
// Authorization was granted.
}
...
...
Please
register
or
login
to post a comment