Navaron Bracke

forward raw format value to Android; set cameraResolution argument regardless of platform

@@ -136,6 +136,7 @@ class MobileScannerController { @@ -136,6 +136,7 @@ class MobileScannerController {
136 arguments['torch'] = torchEnabled; 136 arguments['torch'] = torchEnabled;
137 arguments['speed'] = detectionSpeed.rawValue; 137 arguments['speed'] = detectionSpeed.rawValue;
138 arguments['timeout'] = detectionTimeoutMs; 138 arguments['timeout'] = detectionTimeoutMs;
  139 + arguments['returnImage'] = returnImage;
139 140
140 /* if (scanWindow != null) { 141 /* if (scanWindow != null) {
141 arguments['scanWindow'] = [ 142 arguments['scanWindow'] = [
@@ -147,19 +148,18 @@ class MobileScannerController { @@ -147,19 +148,18 @@ class MobileScannerController {
147 } */ 148 } */
148 149
149 if (formats != null) { 150 if (formats != null) {
150 - if (kIsWeb || Platform.isIOS || Platform.isMacOS) { 151 + if (kIsWeb || Platform.isIOS || Platform.isMacOS || Platform.isAndroid) {
151 arguments['formats'] = formats!.map((e) => e.rawValue).toList(); 152 arguments['formats'] = formats!.map((e) => e.rawValue).toList();
152 - } else if (Platform.isAndroid) {  
153 - arguments['formats'] = formats!.map((e) => e.index).toList();  
154 - if (cameraResolution != null) {  
155 - arguments['cameraResolution'] = <int>[  
156 - cameraResolution!.width.toInt(),  
157 - cameraResolution!.height.toInt(),  
158 - ];  
159 - }  
160 } 153 }
161 } 154 }
162 - arguments['returnImage'] = returnImage; 155 +
  156 + if (cameraResolution != null) {
  157 + arguments['cameraResolution'] = <int>[
  158 + cameraResolution!.width.toInt(),
  159 + cameraResolution!.height.toInt(),
  160 + ];
  161 + }
  162 +
163 return arguments; 163 return arguments;
164 } 164 }
165 165