Showing
2 changed files
with
6 additions
and
8 deletions
| 1 | import 'dart:async'; | 1 | import 'dart:async'; |
| 2 | -import 'dart:js'; | ||
| 3 | import 'dart:js_interop'; | 2 | import 'dart:js_interop'; |
| 4 | import 'dart:ui'; | 3 | import 'dart:ui'; |
| 5 | 4 | ||
| @@ -70,13 +69,13 @@ abstract class BarcodeReader { | @@ -70,13 +69,13 @@ abstract class BarcodeReader { | ||
| 70 | ..lang = 'javascript' | 69 | ..lang = 'javascript' |
| 71 | ..crossOrigin = 'anonymous' | 70 | ..crossOrigin = 'anonymous' |
| 72 | ..src = alternateScriptUrl ?? scriptUrl | 71 | ..src = alternateScriptUrl ?? scriptUrl |
| 73 | - ..onload = allowInterop((JSAny _) { | 72 | + ..onload = (JSAny _) { |
| 74 | if (!completer.isCompleted) { | 73 | if (!completer.isCompleted) { |
| 75 | completer.complete(); | 74 | completer.complete(); |
| 76 | } | 75 | } |
| 77 | - }).toJS; | 76 | + }.toJS; |
| 78 | 77 | ||
| 79 | - script.onerror = allowInterop((JSAny _) { | 78 | + script.onerror = (JSAny _) { |
| 80 | if (!completer.isCompleted) { | 79 | if (!completer.isCompleted) { |
| 81 | // Remove the script if it did not load. | 80 | // Remove the script if it did not load. |
| 82 | document.head!.removeChild(script); | 81 | document.head!.removeChild(script); |
| @@ -91,7 +90,7 @@ abstract class BarcodeReader { | @@ -91,7 +90,7 @@ abstract class BarcodeReader { | ||
| 91 | ), | 90 | ), |
| 92 | ); | 91 | ); |
| 93 | } | 92 | } |
| 94 | - }).toJS; | 93 | + }.toJS; |
| 95 | 94 | ||
| 96 | document.head!.appendChild(script); | 95 | document.head!.appendChild(script); |
| 97 | 96 |
| 1 | import 'dart:async'; | 1 | import 'dart:async'; |
| 2 | -import 'dart:js'; | ||
| 3 | import 'dart:js_interop'; | 2 | import 'dart:js_interop'; |
| 4 | import 'dart:ui'; | 3 | import 'dart:ui'; |
| 5 | 4 | ||
| @@ -182,7 +181,7 @@ final class ZXingBarcodeReader extends BarcodeReader { | @@ -182,7 +181,7 @@ final class ZXingBarcodeReader extends BarcodeReader { | ||
| 182 | _reader?.decodeContinuously.callAsFunction( | 181 | _reader?.decodeContinuously.callAsFunction( |
| 183 | null, | 182 | null, |
| 184 | _reader?.videoElement, | 183 | _reader?.videoElement, |
| 185 | - allowInterop((Result? result, JSAny? error) { | 184 | + (Result? result, JSAny? error) { |
| 186 | if (!controller.isClosed && result != null) { | 185 | if (!controller.isClosed && result != null) { |
| 187 | controller.add( | 186 | controller.add( |
| 188 | BarcodeCapture( | 187 | BarcodeCapture( |
| @@ -190,7 +189,7 @@ final class ZXingBarcodeReader extends BarcodeReader { | @@ -190,7 +189,7 @@ final class ZXingBarcodeReader extends BarcodeReader { | ||
| 190 | ), | 189 | ), |
| 191 | ); | 190 | ); |
| 192 | } | 191 | } |
| 193 | - }).toJS, | 192 | + }.toJS, |
| 194 | ); | 193 | ); |
| 195 | }; | 194 | }; |
| 196 | 195 |
-
Please register or login to post a comment