juliuscanute / qr_code_scanner

QR Code Scanner for Flutter
BSD 2-Clause "Simplified" License
996 stars 743 forks source link

[BUG] Camera not Pause in IOS #679

Open nguyenthao1988 opened 1 year ago

nguyenthao1988 commented 1 year ago

I run Build app in Android start and stop Scan working ok. But app Build in IOS 13 pro max (all Device IOS), thís Code not Pause camera when i call function: controller?.pauseCamera().

How to fix this issue in IOS.

Shajk0 commented 1 year ago

Yes, I have the same issue

frandepy2 commented 8 months ago

Me too, I have the same Issue in Iphone 15 with IOS 17.

nguyenthao1988 commented 8 months ago

I make like it. It's working well on IOS Iphone 13 promax ` void startScan() async { if (Platform.isAndroid) { setState(() { isScan = !isScan; }); await controller?.resumeCamera(); if (kDebugMode) { print("start scan"); } } else if (Platform.isIOS) { listQrcodeScaned.clear(); setState(() { isScan = !isScan; isFlashLight = false; }); if (kDebugMode) { print("stop scan new"); } controller!.pauseCamera(); controller!.resumeCamera(); }

}

void stopScan() async { if (Platform.isAndroid) { controller?.dispose(); listQrcodeScaned.clear(); setState(() { isScan = !isScan; isFlashLight = false; }); if (kDebugMode) { print("stop scan"); } } else if (Platform.isIOS) { setState(() { isScan = !isScan; }); await controller?.pauseCamera(); if (kDebugMode) { print("start scan new"); } } }`