diff --git a/lib/src/qr_code_scanner.dart b/lib/src/qr_code_scanner.dart index bb509e7..eec48b1 100644 --- a/lib/src/qr_code_scanner.dart +++ b/lib/src/qr_code_scanner.dart @@ -132,8 +132,8 @@ class _QRViewState extends State { _channel = MethodChannel('net.touchcapture.qr.flutterqr/qrview_$id'); // Start scan after creation of the view - final controller = QRViewController._(_channel, widget.key, cutOutSize, - widget.onPermissionSet) + final controller = QRViewController._( + _channel, widget.key, cutOutSize, widget.onPermissionSet) .._startScan(widget.key, cutOutSize, widget.formatsAllowed); // Initialize the controller for controlling the QRView @@ -158,12 +158,9 @@ class _QrCameraSettings { } class QRViewController { - QRViewController._( - MethodChannel channel, - GlobalKey qrKey, - double scanArea, - PermissionSetCallback onPermissionSet - ) : _channel = channel { + QRViewController._(MethodChannel channel, GlobalKey qrKey, double scanArea, + PermissionSetCallback onPermissionSet) + : _channel = channel { _channel.setMethodCallHandler((call) async { switch (call.method) { case 'onRecognizeQR': @@ -212,14 +209,12 @@ class QRViewController { bool get hasPermissions => _hasPermissions; /// Starts the barcode scanner - Future _startScan( - GlobalKey key, - double cutOutSize, + Future _startScan(GlobalKey key, double cutOutSize, List barcodeFormats) async { // We need to update the dimension before the scan is started. QRViewController.updateDimensions(key, _channel, scanArea: cutOutSize); - return _channel.invokeMethod('startScan', - barcodeFormats?.map((e) => e.asInt())?.toList() ?? []); + return _channel.invokeMethod( + 'startScan', barcodeFormats?.map((e) => e.asInt())?.toList() ?? []); } /// Gets information about which camera is active.