Navaron Bracke

use rawValue instead of index for enums

@@ -139,7 +139,7 @@ class MobileScannerWebPlugin { @@ -139,7 +139,7 @@ class MobileScannerWebPlugin {
139 'rawBytes': code.rawBytes, 139 'rawBytes': code.rawBytes,
140 'format': code.format.rawValue, 140 'format': code.format.rawValue,
141 'displayValue': code.displayValue, 141 'displayValue': code.displayValue,
142 - 'type': code.type.index, 142 + 'type': code.type.rawValue,
143 if (corners != null && corners.isNotEmpty) 143 if (corners != null && corners.isNotEmpty)
144 'corners': corners 144 'corners': corners
145 .map( 145 .map(
@@ -132,9 +132,9 @@ class MobileScannerController { @@ -132,9 +132,9 @@ class MobileScannerController {
132 final Map<String, dynamic> arguments = {}; 132 final Map<String, dynamic> arguments = {};
133 133
134 cameraFacingState.value = cameraFacingOverride ?? facing; 134 cameraFacingState.value = cameraFacingOverride ?? facing;
135 - arguments['facing'] = cameraFacingState.value.index; 135 + arguments['facing'] = cameraFacingState.value.rawValue;
136 arguments['torch'] = torchEnabled; 136 arguments['torch'] = torchEnabled;
137 - arguments['speed'] = detectionSpeed.index; 137 + arguments['speed'] = detectionSpeed.rawValue;
138 arguments['timeout'] = detectionTimeoutMs; 138 arguments['timeout'] = detectionTimeoutMs;
139 139
140 /* if (scanWindow != null) { 140 /* if (scanWindow != null) {
@@ -329,7 +329,7 @@ class MobileScannerController { @@ -329,7 +329,7 @@ class MobileScannerController {
329 torchState.value = 329 torchState.value =
330 torchState.value == TorchState.off ? TorchState.on : TorchState.off; 330 torchState.value == TorchState.off ? TorchState.on : TorchState.off;
331 331
332 - await _methodChannel.invokeMethod('torch', torchState.value.index); 332 + await _methodChannel.invokeMethod('torch', torchState.value.rawValue);
333 } 333 }
334 334
335 /// Changes the state of the camera (front or back). 335 /// Changes the state of the camera (front or back).