Showing
1 changed file
with
6 additions
and
2 deletions
| @@ -144,7 +144,9 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler, | @@ -144,7 +144,9 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler, | ||
| 144 | } | 144 | } |
| 145 | } | 145 | } |
| 146 | } else { | 146 | } else { |
| 147 | - self?.sink?(FlutterError(code: "MobileScanner", message: error?.localizedDescription, details: nil)) | 147 | + DispatchQueue.main.async { |
| 148 | + self?.sink?(FlutterError(code: "MobileScanner", message: error?.localizedDescription, details: nil)) | ||
| 149 | + } | ||
| 148 | } | 150 | } |
| 149 | }) | 151 | }) |
| 150 | if(self?.symbologies.isEmpty == false){ | 152 | if(self?.symbologies.isEmpty == false){ |
| @@ -153,7 +155,9 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler, | @@ -153,7 +155,9 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler, | ||
| 153 | } | 155 | } |
| 154 | try imageRequestHandler.perform([barcodeRequest]) | 156 | try imageRequestHandler.perform([barcodeRequest]) |
| 155 | } catch let e { | 157 | } catch let e { |
| 156 | - self?.sink?(FlutterError(code: "MobileScanner", message: e.localizedDescription, details: nil)) | 158 | + DispatchQueue.main.async { |
| 159 | + self?.sink?(FlutterError(code: "MobileScanner", message: e.localizedDescription, details: nil)) | ||
| 160 | + } | ||
| 157 | } | 161 | } |
| 158 | } | 162 | } |
| 159 | } | 163 | } |
-
Please register or login to post a comment