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
2022-12-11 19:42:48 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
bbc30f5ff3f907d2cd1de5034f2ed16478857293
bbc30f5f
1 parent
dff22cca
handle camera permission error in the controller
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
lib/src/mobile_scanner_controller.dart
lib/src/mobile_scanner_controller.dart
View file @
bbc30f5
...
...
@@ -159,14 +159,23 @@ class MobileScannerController {
.
values
[
await
_methodChannel
.
invokeMethod
(
'state'
)
as
int
?
??
0
];
switch
(
state
)
{
case
MobileScannerState
.
undetermined
:
final
bool
result
=
await
_methodChannel
.
invokeMethod
(
'request'
)
as
bool
?
??
false
;
if
(!
result
)
{
isStarting
=
false
;
try
{
final
bool
result
=
await
_methodChannel
.
invokeMethod
(
'request'
)
as
bool
?
??
false
;
if
(!
result
)
{
throw
const
MobileScannerException
(
errorCode:
MobileScannerErrorCode
.
permissionDenied
,
);
}
}
catch
(
error
)
{
throw
const
MobileScannerException
(
errorCode:
MobileScannerErrorCode
.
permissionDenied
,
errorCode:
MobileScannerErrorCode
.
genericError
,
);
}
finally
{
isStarting
=
false
;
}
break
;
case
MobileScannerState
.
denied
:
isStarting
=
false
;
...
...
Please
register
or
login
to post a comment