Skip to content

Commit

Permalink
forward raw format value to Android; set cameraResolution argument re…
Browse files Browse the repository at this point in the history
…gardless of platform
  • Loading branch information
navaronbracke committed Oct 23, 2023
1 parent 2f913f9 commit 5eb93f8
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/src/mobile_scanner_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class MobileScannerController {
arguments['torch'] = torchEnabled;
arguments['speed'] = detectionSpeed.rawValue;
arguments['timeout'] = detectionTimeoutMs;
arguments['returnImage'] = returnImage;

/* if (scanWindow != null) {
arguments['scanWindow'] = [
Expand All @@ -147,19 +148,18 @@ class MobileScannerController {
} */

if (formats != null) {
if (kIsWeb || Platform.isIOS || Platform.isMacOS) {
if (kIsWeb || Platform.isIOS || Platform.isMacOS || Platform.isAndroid) {
arguments['formats'] = formats!.map((e) => e.rawValue).toList();
} else if (Platform.isAndroid) {
arguments['formats'] = formats!.map((e) => e.index).toList();
if (cameraResolution != null) {
arguments['cameraResolution'] = <int>[
cameraResolution!.width.toInt(),
cameraResolution!.height.toInt(),
];
}
}
}
arguments['returnImage'] = returnImage;

if (cameraResolution != null) {
arguments['cameraResolution'] = <int>[
cameraResolution!.width.toInt(),
cameraResolution!.height.toInt(),
];
}

return arguments;
}

Expand Down

0 comments on commit 5eb93f8

Please sign in to comment.