When I enter the code scanning page for the first time, the code scanning area is incorrect. After returning to the previous page, I re-enter the code scanning area and the code scanning area is correct,My QRView is full screen.
my device is iPhone12,and iphoneSE2, OS version:iOS 14.4, qr_code_scanner version:0.3.2
here is my code:
Barcode result;
QRViewController controller;
final GlobalKey qrKey = GlobalKey(debugLabel: 'QR');
void reassemble() {
super.reassemble();
if (Platform.isAndroid) {
controller.pauseCamera();
} else if (Platform.isIOS) {
controller.resumeCamera();
}
}
When I enter the code scanning page for the first time, the code scanning area is incorrect. After returning to the previous page, I re-enter the code scanning area and the code scanning area is correct,My QRView is full screen.
my device is iPhone12,and iphoneSE2, OS version:iOS 14.4, qr_code_scanner version:0.3.2
here is my code: Barcode result; QRViewController controller; final GlobalKey qrKey = GlobalKey(debugLabel: 'QR');
void reassemble() { super.reassemble(); if (Platform.isAndroid) { controller.pauseCamera(); } else if (Platform.isIOS) { controller.resumeCamera(); } }
@override Widget build(BuildContext context) { return Scaffold( body: _buildQrView(context), ); }
Widget _buildQrView(BuildContext context) { return QRView( key: qrKey, formatsAllowed: [BarcodeFormat.qrcode,BarcodeFormat.code128,BarcodeFormat.code39,BarcodeFormat.code93,BarcodeFormat.ean8,BarcodeFormat.upcE,BarcodeFormat.pdf417,BarcodeFormat.ean13,], onQRViewCreated: _onQRViewCreated, ); }
void _onQRViewCreated(QRViewController controller) { setState(() { this.controller = controller; }); controller.scannedDataStream.listen((scanData) { setState(() { result = scanData; print("result:$result"); }); }); }
@override void dispose() { controller?.dispose(); super.dispose(); }