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-04-09 11:12:40 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
df286f97b4916a1b235bfc753dac322ccffe93fe
df286f97
1 parent
d9606622
use the HTMLScriptElement constructor
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
lib/src/web/barcode_reader.dart
lib/src/web/barcode_reader.dart
View file @
df286f9
...
...
@@ -62,20 +62,19 @@ abstract class BarcodeReader {
final
Completer
<
void
>
completer
=
Completer
();
final
HTMLScriptElement
script
=
(
document
.
createElement
(
'script'
)
as
HTMLScriptElement
)
..
id
=
scriptId
..
async
=
true
..
defer
=
false
..
type
=
'application/javascript'
..
lang
=
'javascript'
..
crossOrigin
=
'anonymous'
..
src
=
alternateScriptUrl
??
scriptUrl
..
onload
=
(
JSAny
_
)
{
if
(!
completer
.
isCompleted
)
{
completer
.
complete
();
}
}.
toJS
;
final
HTMLScriptElement
script
=
HTMLScriptElement
()
..
id
=
scriptId
..
async
=
true
..
defer
=
false
..
type
=
'application/javascript'
..
lang
=
'javascript'
..
crossOrigin
=
'anonymous'
..
src
=
alternateScriptUrl
??
scriptUrl
..
onload
=
(
JSAny
_
)
{
if
(!
completer
.
isCompleted
)
{
completer
.
complete
();
}
}.
toJS
;
script
.
onerror
=
(
JSAny
_
)
{
if
(!
completer
.
isCompleted
)
{
...
...
Please
register
or
login
to post a comment