Showing
2 changed files
with
4 additions
and
4 deletions
| @@ -52,8 +52,8 @@ class MobileScannerHandler( | @@ -52,8 +52,8 @@ class MobileScannerHandler( | ||
| 52 | "data" to barcodes, | 52 | "data" to barcodes, |
| 53 | "image" to mapOf( | 53 | "image" to mapOf( |
| 54 | "bytes" to image, | 54 | "bytes" to image, |
| 55 | - "width" to width!!.toDouble(), | ||
| 56 | - "height" to height!!.toDouble(), | 55 | + "width" to width?.toDouble(), |
| 56 | + "height" to height?.toDouble(), | ||
| 57 | ) | 57 | ) |
| 58 | )) | 58 | )) |
| 59 | } else { | 59 | } else { |
| @@ -165,8 +165,8 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler, | @@ -165,8 +165,8 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler, | ||
| 165 | "data": barcodes.map({ $0.toMap() }), | 165 | "data": barcodes.map({ $0.toMap() }), |
| 166 | "image": cgImage == nil ? nil : [ | 166 | "image": cgImage == nil ? nil : [ |
| 167 | "bytes": FlutterStandardTypedData(bytes: cgImage!.jpegData(compressionQuality: 0.8)!), | 167 | "bytes": FlutterStandardTypedData(bytes: cgImage!.jpegData(compressionQuality: 0.8)!), |
| 168 | - "width": cgImage!.width, | ||
| 169 | - "height": cgImage!.height, | 168 | + "width": Double(cgImage!.width), |
| 169 | + "height": Double(cgImage!.height), | ||
| 170 | ], | 170 | ], |
| 171 | ]) | 171 | ]) |
| 172 | } | 172 | } |
-
Please register or login to post a comment