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-06-28 13:46:14 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0d390a8a592c8fced22edee05a7d432c67df6391
0d390a8a
1 parent
a6520cbf
await toggle torch; pass stacktrace as details to exception
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
lib/mobile_scanner_web_plugin.dart
lib/mobile_scanner_web_plugin.dart
View file @
0d390a8
...
...
@@ -113,12 +113,14 @@ class MobileScannerWebPlugin {
.
map
((
e
)
=>
toFormat
(
e
))
.
toList
();
}
final
Duration
?
detectionTimeout
;
if
(
arguments
.
containsKey
(
'timeout'
))
{
detectionTimeout
=
Duration
(
milliseconds:
arguments
[
'timeout'
]
as
int
);
}
else
{
detectionTimeout
=
null
;
}
await
barCodeReader
.
start
(
cameraFacing:
cameraFacing
,
formats:
formats
,
...
...
@@ -138,10 +140,11 @@ class MobileScannerWebPlugin {
});
}
});
final
hasTorch
=
await
barCodeReader
.
hasTorch
();
if
(
hasTorch
&&
arguments
.
containsKey
(
'torch'
))
{
barCodeReader
.
toggleTorch
(
enabled:
arguments
[
'torch'
]
as
bool
);
await
barCodeReader
.
toggleTorch
(
enabled:
arguments
[
'torch'
]
as
bool
);
}
return
{
...
...
@@ -150,8 +153,12 @@ class MobileScannerWebPlugin {
'videoHeight'
:
barCodeReader
.
videoHeight
,
'torchable'
:
hasTorch
,
};
}
catch
(
e
)
{
throw
PlatformException
(
code:
'MobileScannerWeb'
,
message:
'
$e
'
);
}
catch
(
e
,
stackTrace
)
{
throw
PlatformException
(
code:
'MobileScannerWeb'
,
message:
'
$e
'
,
details:
stackTrace
.
toString
(),
);
}
}
...
...
Please
register
or
login
to post a comment