# DocumentScannerCameraConfiguration.fromJson constructor

DocumentScannerCameraConfiguration.fromJson(

1. Map<String, dynamic> json

)

## Implementation

    factory DocumentScannerCameraConfiguration.fromJson(
            Map<String, dynamic> json) =>
        DocumentScannerCameraConfiguration(
          cameraModule: json.containsKey("cameraModule")
              ? CameraModule.values.byName(json["cameraModule"] as String)
              : CameraModule.BACK,
          defaultZoomFactor: json.containsKey("defaultZoomFactor")
              ? (json["defaultZoomFactor"] as num).toDouble()
              : 1.0,
          autoCropOnManualSnap: json.containsKey("autoCropOnManualSnap")
              ? (json["autoCropOnManualSnap"] as bool)
              : true,
          flashEnabled: json.containsKey("flashEnabled")
              ? (json["flashEnabled"] as bool)
              : false,
          minFocusDistanceLock: json.containsKey("minFocusDistanceLock")
              ? (json["minFocusDistanceLock"] as bool)
              : false,
          touchToFocusEnabled: json.containsKey("touchToFocusEnabled")
              ? (json["touchToFocusEnabled"] as bool)
              : false,
          pinchToZoomEnabled: json.containsKey("pinchToZoomEnabled")
              ? (json["pinchToZoomEnabled"] as bool)
              : true,
          cameraPreviewMode: json.containsKey("cameraPreviewMode")
              ? CameraPreviewMode.values
                  .byName(json["cameraPreviewMode"] as String)
              : CameraPreviewMode.FILL_IN,
          captureQualityPrioritization:
              json.containsKey("captureQualityPrioritization")
                  ? CapturePhotoQualityPrioritization.values
                      .byName(json["captureQualityPrioritization"] as String)
                  : CapturePhotoQualityPrioritization.BALANCED,
          autoSnappingSensitivity: json.containsKey("autoSnappingSensitivity")
              ? (json["autoSnappingSensitivity"] as num).toDouble()
              : 0.66,
          autoSnappingDelay: json.containsKey("autoSnappingDelay")
              ? (json["autoSnappingDelay"] as int)
              : 200,
          autoSnappingEnabled: json.containsKey("autoSnappingEnabled")
              ? (json["autoSnappingEnabled"] as bool)
              : true,
          captureWithHardwareButtonsEnabled:
              json.containsKey("captureWithHardwareButtonsEnabled")
                  ? (json["captureWithHardwareButtonsEnabled"] as bool)
                  : true,
        );