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
2024-01-26 10:21:40 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6497f4df605cd307f23ce3abd98f4084a6f607f9
6497f4df
1 parent
7643054e
fix thisArg for callAsFunction() calls
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
lib/src/web/zxing/zxing_barcode_reader.dart
lib/src/web/zxing/zxing_barcode_reader.dart
View file @
6497f4d
...
...
@@ -162,7 +162,7 @@ final class ZXingBarcodeReader extends BarcodeReader {
if
(
stream
!=
null
)
{
final
JSPromise
?
result
=
_reader
?.
attachStreamToVideo
.
callAsFunction
(
null
,
_reader
as
JSAny
?
,
stream
as
JSAny
,
videoElement
as
JSAny
,
)
as
JSPromise
?;
...
...
@@ -184,7 +184,7 @@ final class ZXingBarcodeReader extends BarcodeReader {
controller
.
onListen
=
()
{
_reader
?.
decodeContinuously
.
callAsFunction
(
null
,
_reader
as
JSAny
?
,
_reader
?.
videoElement
as
JSAny
?,
(
Result
?
result
,
JSAny
?
error
)
{
if
(!
controller
.
isClosed
&&
result
!=
null
)
{
...
...
@@ -202,8 +202,8 @@ final class ZXingBarcodeReader extends BarcodeReader {
// when the stream subscription returned by this method is cancelled in `MobileScannerWeb.stop()`.
// This avoids both leaving the barcode scanner running and a memory leak for the stream subscription.
controller
.
onCancel
=
()
async
{
_reader
?.
stopContinuousDecode
.
callAsFunction
();
_reader
?.
reset
.
callAsFunction
();
_reader
?.
stopContinuousDecode
.
callAsFunction
(
_reader
as
JSAny
?);
_reader
?.
reset
.
callAsFunction
(
_reader
as
JSAny
?);
await
controller
.
close
();
};
...
...
@@ -285,8 +285,8 @@ final class ZXingBarcodeReader extends BarcodeReader {
@override
Future
<
void
>
stop
()
async
{
_onMediaTrackSettingsChanged
=
null
;
_reader
?.
stopContinuousDecode
.
callAsFunction
();
_reader
?.
reset
.
callAsFunction
();
_reader
?.
stopContinuousDecode
.
callAsFunction
(
_reader
as
JSAny
?);
_reader
?.
reset
.
callAsFunction
(
_reader
as
JSAny
?);
_reader
=
null
;
}
}
...
...
Please
register
or
login
to post a comment