CameraPicker constructor

CameraPicker({
  1. Key? key,
  2. bool enableRecording = false,
  3. bool onlyEnableRecording = false,
  4. bool enableTapRecording = false,
  5. bool enableAudio = true,
  6. bool enableSetExposure = true,
  7. bool enableExposureControlOnPoint = true,
  8. bool enablePinchToZoom = true,
  9. bool enablePullToZoomInRecord = true,
  10. bool shouldDeletePreviewFile = false,
  11. bool shouldAutoPreviewVideo = false,
  12. Duration? maximumRecordingDuration = const Duration(seconds: 15),
  13. ThemeData? theme,
  14. ResolutionPreset resolutionPreset = ResolutionPreset.max,
  15. ImageFormatGroup imageFormatGroup = ImageFormatGroup.unknown,
  16. CameraLensDirection preferredLensDirection = CameraLensDirection.back,
  17. int cameraQuarterTurns = 0,
  18. Widget foregroundBuilder(
    1. CameraValue
    )?,
  19. EntitySaveCallback? onEntitySaving,
  20. CameraErrorHandler? onError,
  21. CameraPickerTextDelegate? textDelegate,
})

Implementation

CameraPicker({
  Key? key,
  this.enableRecording = false,
  this.onlyEnableRecording = false,
  this.enableTapRecording = false,
  this.enableAudio = true,
  this.enableSetExposure = true,
  this.enableExposureControlOnPoint = true,
  this.enablePinchToZoom = true,
  this.enablePullToZoomInRecord = true,
  this.shouldDeletePreviewFile = false,
  this.shouldAutoPreviewVideo = false,
  this.maximumRecordingDuration = const Duration(seconds: 15),
  this.theme,
  this.resolutionPreset = ResolutionPreset.max,
  this.imageFormatGroup = ImageFormatGroup.unknown,
  this.preferredLensDirection = CameraLensDirection.back,
  this.cameraQuarterTurns = 0,
  this.foregroundBuilder,
  this.onEntitySaving,
  this.onError,
  CameraPickerTextDelegate? textDelegate,
})  : assert(
        enableRecording == true || onlyEnableRecording != true,
        'Recording mode error.',
      ),
      super(key: key) {
  // Set text delegate accordingly.
  if (textDelegate != null) {
    Constants.textDelegate = textDelegate;
  } else if (enableRecording && onlyEnableRecording && enableTapRecording) {
    Constants.textDelegate =
        DefaultCameraPickerTextDelegateWithTapRecording();
  } else if (enableRecording && onlyEnableRecording) {
    Constants.textDelegate =
        DefaultCameraPickerTextDelegateWithOnlyRecording();
  } else if (enableRecording) {
    Constants.textDelegate = DefaultCameraPickerTextDelegateWithRecording();
  } else {
    Constants.textDelegate = DefaultCameraPickerTextDelegate();
  }
}