Showing
3 changed files
with
10 additions
and
7 deletions
@@ -16,7 +16,6 @@ | @@ -16,7 +16,6 @@ | ||
16 | 16 | ||
17 | import 'dart:async'; | 17 | import 'dart:async'; |
18 | import 'dart:html' as html; | 18 | import 'dart:html' as html; |
19 | -import 'dart:html'; | ||
20 | import 'dart:js' as js; | 19 | import 'dart:js' as js; |
21 | import 'dart:js_util'; | 20 | import 'dart:js_util'; |
22 | import 'dart:typed_data'; | 21 | import 'dart:typed_data'; |
@@ -87,12 +86,12 @@ class PrintingPlugin extends PrintingPlatform { | @@ -87,12 +86,12 @@ class PrintingPlugin extends PrintingPlatform { | ||
87 | } | 86 | } |
88 | js.context['module'] = 0; | 87 | js.context['module'] = 0; |
89 | 88 | ||
90 | - final script = ScriptElement() | 89 | + final script = html.ScriptElement() |
91 | ..type = 'text/javascript' | 90 | ..type = 'text/javascript' |
92 | ..async = true | 91 | ..async = true |
93 | ..src = '$_pdfJsUrlBase/build/pdf.min.js'; | 92 | ..src = '$_pdfJsUrlBase/build/pdf.min.js'; |
94 | - assert(document.head != null); | ||
95 | - document.head!.append(script); | 93 | + assert(html.document.head != null); |
94 | + html.document.head!.append(script); | ||
96 | await script.onLoad.first; | 95 | await script.onLoad.first; |
97 | 96 | ||
98 | if (amd != null) { | 97 | if (amd != null) { |
@@ -344,10 +343,10 @@ class PrintingPlugin extends PrintingPlatform { | @@ -344,10 +343,10 @@ class PrintingPlugin extends PrintingPlatform { | ||
344 | final completer = Completer<void>(); | 343 | final completer = Completer<void>(); |
345 | final blob = await canvas.toBlob(); | 344 | final blob = await canvas.toBlob(); |
346 | final data = BytesBuilder(); | 345 | final data = BytesBuilder(); |
347 | - final r = FileReader(); | 346 | + final r = html.FileReader(); |
348 | r.readAsArrayBuffer(blob); | 347 | r.readAsArrayBuffer(blob); |
349 | r.onLoadEnd.listen( | 348 | r.onLoadEnd.listen( |
350 | - (ProgressEvent e) { | 349 | + (html.ProgressEvent e) { |
351 | data.add(r.result as List<int>); | 350 | data.add(r.result as List<int>); |
352 | completer.complete(); | 351 | completer.complete(); |
353 | }, | 352 | }, |
-
Please register or login to post a comment