Showing
1 changed file
with
4 additions
and
5 deletions
| @@ -138,11 +138,10 @@ final class ZXingBarcodeReader extends BarcodeReader { | @@ -138,11 +138,10 @@ final class ZXingBarcodeReader extends BarcodeReader { | ||
| 138 | required web.MediaStream videoStream, | 138 | required web.MediaStream videoStream, |
| 139 | }) async { | 139 | }) async { |
| 140 | final int detectionTimeoutMs = options.detectionTimeoutMs; | 140 | final int detectionTimeoutMs = options.detectionTimeoutMs; |
| 141 | - final List<BarcodeFormat> formats = options.formats; | ||
| 142 | - | ||
| 143 | - if (formats.contains(BarcodeFormat.unknown)) { | ||
| 144 | - formats.removeWhere((element) => element == BarcodeFormat.unknown); | ||
| 145 | - } | 141 | + final List<BarcodeFormat> formats = [ |
| 142 | + for (final BarcodeFormat format in options.formats) | ||
| 143 | + if (format != BarcodeFormat.unknown) format, | ||
| 144 | + ]; | ||
| 146 | 145 | ||
| 147 | _reader = ZXingBrowserMultiFormatReader( | 146 | _reader = ZXingBrowserMultiFormatReader( |
| 148 | _createReaderHints(formats), | 147 | _createReaderHints(formats), |
-
Please register or login to post a comment