flutter-package / flutter_scan

scanner qrcode in widget tree & decoder qrcode from image
MIT License
79 stars 66 forks source link

no 'auto focus' feature #64

Open smalltask opened 1 year ago

smalltask commented 1 year ago

Environment

Flutter version: 3.13.4 Plugin version:
Android version:
iOS version: 17.0 Xcode version: 15.0 Device information:** iOS XS MAX

there have no 'auto focus' feature

smalltask commented 1 year ago
private func autoFocusModel() {
    guard let device = AVCaptureDevice.default(for: .video) else { return }
    guard device.hasTorch else { return }
    do {
        try device.lockForConfiguration();

        if(device.isFocusPointOfInterestSupported && device.isFocusModeSupported(.continuousAutoFocus)) {
            device.focusPointOfInterest = self.center
            device.focusMode = .continuousAutoFocus
        }

        device.unlockForConfiguration();
    } catch {
        print(error);
    }
}