Showing
2 changed files
with
8 additions
and
4 deletions
| @@ -6,6 +6,7 @@ import 'package:flutter/services.dart'; | @@ -6,6 +6,7 @@ import 'package:flutter/services.dart'; | ||
| 6 | import 'package:flutter_web_plugins/flutter_web_plugins.dart'; | 6 | import 'package:flutter_web_plugins/flutter_web_plugins.dart'; |
| 7 | import 'package:mobile_scanner/mobile_scanner_web.dart'; | 7 | import 'package:mobile_scanner/mobile_scanner_web.dart'; |
| 8 | import 'package:mobile_scanner/src/enums/camera_facing.dart'; | 8 | import 'package:mobile_scanner/src/enums/camera_facing.dart'; |
| 9 | +import 'package:mobile_scanner/src/objects/barcode.dart'; | ||
| 9 | 10 | ||
| 10 | /// This plugin is the web implementation of mobile_scanner. | 11 | /// This plugin is the web implementation of mobile_scanner. |
| 11 | /// It only supports QR codes. | 12 | /// It only supports QR codes. |
| @@ -102,6 +103,7 @@ class MobileScannerWebPlugin { | @@ -102,6 +103,7 @@ class MobileScannerWebPlugin { | ||
| 102 | 'data': { | 103 | 'data': { |
| 103 | 'rawValue': code.rawValue, | 104 | 'rawValue': code.rawValue, |
| 104 | 'rawBytes': code.rawBytes, | 105 | 'rawBytes': code.rawBytes, |
| 106 | + 'format': code.format.rawValue, | ||
| 105 | }, | 107 | }, |
| 106 | }); | 108 | }); |
| 107 | } | 109 | } |
| @@ -333,10 +333,12 @@ class MobileScannerController { | @@ -333,10 +333,12 @@ class MobileScannerController { | ||
| 333 | _barcodesController.add( | 333 | _barcodesController.add( |
| 334 | BarcodeCapture( | 334 | BarcodeCapture( |
| 335 | barcodes: [ | 335 | barcodes: [ |
| 336 | - Barcode( | ||
| 337 | - rawValue: barcode?['rawValue'] as String?, | ||
| 338 | - rawBytes: barcode?['rawBytes'] as Uint8List?, | ||
| 339 | - ) | 336 | + if (barcode != null) |
| 337 | + Barcode( | ||
| 338 | + rawValue: barcode['rawValue'] as String?, | ||
| 339 | + rawBytes: barcode['rawBytes'] as Uint8List?, | ||
| 340 | + format: toFormat(barcode['format'] as int), | ||
| 341 | + ), | ||
| 340 | ], | 342 | ], |
| 341 | ), | 343 | ), |
| 342 | ); | 344 | ); |
-
Please register or login to post a comment