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 20:39:57 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
770104db6f3b868a393a63aef77e88eb45407c20
770104db
1 parent
12c5db10
fix bug with try catch
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
lib/src/mobile_scanner_controller.dart
lib/src/mobile_scanner_controller.dart
View file @
770104d
...
...
@@ -159,21 +159,23 @@ class MobileScannerController {
.
values
[
await
_methodChannel
.
invokeMethod
(
'state'
)
as
int
?
??
0
];
switch
(
state
)
{
case
MobileScannerState
.
undetermined
:
bool
result
=
false
;
try
{
final
bool
result
=
result
=
await
_methodChannel
.
invokeMethod
(
'request'
)
as
bool
?
??
false
;
if
(!
result
)
{
throw
const
MobileScannerException
(
errorCode:
MobileScannerErrorCode
.
permissionDenied
,
);
}
}
catch
(
error
)
{
isStarting
=
false
;
throw
const
MobileScannerException
(
errorCode:
MobileScannerErrorCode
.
genericError
,
);
}
finally
{
}
if
(!
result
)
{
isStarting
=
false
;
throw
const
MobileScannerException
(
errorCode:
MobileScannerErrorCode
.
permissionDenied
,
);
}
break
;
...
...
Please
register
or
login
to post a comment