|
|
@@ -23,11 +23,11 @@ public class QRView:NSObject,FlutterPlatformView { |
|
|
func isCameraAvailable(success: Bool) -> Void { |
|
|
func isCameraAvailable(success: Bool) -> Void { |
|
|
if success { |
|
|
if success { |
|
|
do { |
|
|
do { |
|
|
try scanner?.startScanning(resultBlock: { codes in |
|
|
|
|
|
|
|
|
try scanner?.startScanning(resultBlock: { [weak self] codes in |
|
|
if let codes = codes { |
|
|
if let codes = codes { |
|
|
for code in codes { |
|
|
for code in codes { |
|
|
guard let stringValue = code.stringValue else { continue } |
|
|
guard let stringValue = code.stringValue else { continue } |
|
|
self.channel.invokeMethod("onRecognizeQR", arguments: stringValue) |
|
|
|
|
|
|
|
|
self?.channel.invokeMethod("onRecognizeQR", arguments: stringValue) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|