Skip to content

Commit

Permalink
Fix: On Android the X and Y seems to be swapped. (Also the order of c…
Browse files Browse the repository at this point in the history
…orners seems not correct, but that does not influence this use-case.
  • Loading branch information
Sander Roest committed Oct 7, 2024
1 parent ac7ca64 commit e10b7b3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion example/lib/picklist/classes/barcode_at_center.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:mobile_scanner/mobile_scanner.dart';

Expand All @@ -7,7 +9,9 @@ import 'package:mobile_scanner/mobile_scanner.dart';
///
/// https://github.com/juliansteenbakker/mobile_scanner/issues/1183
Barcode? findBarcodeAtCenter(BarcodeCapture barcodeCapture) {
final imageSize = barcodeCapture.size;
final imageSize = Platform.isAndroid
? Size(barcodeCapture.size.height, barcodeCapture.size.width)
: barcodeCapture.size;
for (final barcode in barcodeCapture.barcodes) {
if (_isPolygonTouchingTheCenter(
imageSize: imageSize,
Expand Down

0 comments on commit e10b7b3

Please sign in to comment.