11// ignore: avoid_web_libraries_in_flutter
22import 'dart:html' as html;
33import 'dart:ui' as ui;
4- import 'dart:js' as js;
54
65import 'package:flutter/material.dart' ;
76import 'package:simple_barcode_scanner/constant.dart' ;
@@ -16,8 +15,6 @@ class BarcodeScanner extends StatelessWidget {
1615 final Function (String ) onScanned;
1716 final String ? appBarTitle;
1817 final bool ? centerTitle;
19- final int scanWidth;
20- final int scanHeight;
2118
2219 const BarcodeScanner ({
2320 Key ? key,
@@ -28,8 +25,6 @@ class BarcodeScanner extends StatelessWidget {
2825 required this .onScanned,
2926 this .appBarTitle,
3027 this .centerTitle,
31- this .scanWidth = 288 ,
32- this .scanHeight = 120
3328 }) : super (key: key);
3429
3530 @override
@@ -41,15 +36,8 @@ class BarcodeScanner extends StatelessWidget {
4136 ..src = PackageConstant .barcodeFileWebPath
4237 ..style.border = 'none'
4338 ..onLoad.listen ((event) async {
44- html.window.onMessage.listen ((event) {
45- /// Create reader setting qrBox width and height
46- html.CustomEvent event = new html.CustomEvent ("reader" , detail : {
47- "qrBoxWidth" : scanWidth,
48- "qrBoxHeight" : scanHeight
49- });
50- html.window.document.dispatchEvent (event);
51-
5239 /// Barcode listener on success barcode scanned
40+ html.window.onMessage.listen ((event) {
5341 /// If barcode is null then assign scanned barcode
5442 /// and close the screen otherwise keep scanning
5543 if (barcodeNumber == null ) {
0 commit comments