Skip to content

Commit e10b7b3

Browse files
author
Sander Roest
committed
Fix: On Android the X and Y seems to be swapped. (Also the order of corners seems not correct, but that does not influence this use-case.
1 parent ac7ca64 commit e10b7b3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

example/lib/picklist/classes/barcode_at_center.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'dart:io';
2+
13
import 'package:flutter/material.dart';
24
import 'package:mobile_scanner/mobile_scanner.dart';
35

@@ -7,7 +9,9 @@ import 'package:mobile_scanner/mobile_scanner.dart';
79
///
810
/// https://github.com/juliansteenbakker/mobile_scanner/issues/1183
911
Barcode? findBarcodeAtCenter(BarcodeCapture barcodeCapture) {
10-
final imageSize = barcodeCapture.size;
12+
final imageSize = Platform.isAndroid
13+
? Size(barcodeCapture.size.height, barcodeCapture.size.width)
14+
: barcodeCapture.size;
1115
for (final barcode in barcodeCapture.barcodes) {
1216
if (_isPolygonTouchingTheCenter(
1317
imageSize: imageSize,

0 commit comments

Comments
 (0)