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-10-22 14:26:37 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f97527089d56fa54ea26bf86a536e10dcb3fd2e7
f9752708
1 parent
7e3a3b07
handle PlatformExceptions from the state call
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletions
lib/src/mobile_scanner_controller.dart
lib/src/mobile_scanner_controller.dart
View file @
f975270
...
...
@@ -185,8 +185,24 @@ class MobileScannerController {
// Check authorization status
if
(!
kIsWeb
)
{
final
MobileScannerState
state
=
MobileScannerState
final
MobileScannerState
state
;
try
{
state
=
MobileScannerState
.
values
[
await
_methodChannel
.
invokeMethod
(
'state'
)
as
int
?
??
0
];
}
on
PlatformException
catch
(
error
)
{
isStarting
=
false
;
throw
MobileScannerException
(
errorCode:
MobileScannerErrorCode
.
genericError
,
errorDetails:
MobileScannerErrorDetails
(
code:
error
.
code
,
details:
error
.
details
as
Object
?,
message:
error
.
message
,
),
);
}
switch
(
state
)
{
case
MobileScannerState
.
undetermined
:
bool
result
=
false
;
...
...
Please
register
or
login
to post a comment