toJson method

Map<String, dynamic> toJson()

Converts the options to a JSON map for platform communication

Implementation

Map<String, dynamic> toJson() {
  return {
    'formats': formats.map((format) => format.name).toList(),
    'enableFlash': enableFlash,
    'autoFocus': autoFocus,
    'multiScan': multiScan,
    'maxScans': maxScans,
    'beepOnScan': beepOnScan,
    'vibrateOnScan': vibrateOnScan,
    'showOverlay': showOverlay,
    'overlayColor': overlayColor,
    'restrictScanArea': restrictScanArea,
    'scanAreaRatio': scanAreaRatio,
    'timeoutSeconds': timeoutSeconds,
    'returnImage': returnImage,
    'imageQuality': imageQuality,
    'detectInverted': detectInverted,
    'cameraResolution': cameraResolution.name,
    'cameraFacing': cameraFacing.name,
  };
}